上一页 1 ··· 31 32 33 34 35
摘要: 定义抽象基类Shape,由它派生出五个派生类:Circle(圆形)、Square(正方形)、Rectangle( 长方形)、Trapezoid (梯形)和Triangle (三角形),用虚函数分别计算各种图形的面积,并求出它们的和。要求用基类指针数组。使它的每一个元素指向一个派生类的对象。PI=3. 阅读全文
posted @ 2023-04-22 20:45 kxzzow 阅读(43) 评论(0) 推荐(0)
摘要: 问题: 现在要开发一个系统,管理对多种汽车的收费工作。给出下面的一个基类框架 class Vehicle { protected: string NO; public: Vehicle(string n){ NO = n; } virtual int fee()=0;//计算应收费用 }; 以Veh 阅读全文
posted @ 2023-04-21 21:29 kxzzow 阅读(84) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; int char_to_num(char ch){ if(ch >= '0' && ch <= '9') return ch - '0'; else return ch - 'A' + 10; } char n 阅读全文
posted @ 2023-04-19 17:34 kxzzow 阅读(10) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; int N = 100010; int q[N]; int main(){ int n, x; cin >> n >> x; for (int i = 0; i < n; i ++){ cin >> q[i]; 阅读全文
posted @ 2023-04-18 16:32 kxzzow 阅读(24) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; int a[100010]; int main(){ int i, j; int N; cin >> N; for(i = 0; i < N; i ++){ cin >> a[i]; } int t = 0; 阅读全文
posted @ 2023-04-17 20:40 kxzzow 阅读(17) 评论(0) 推荐(0)
摘要: 打卡c++趣味 #include<bits/stdc++.h> using namespace std; int main() { int i; double b = 0.0, a = 1000; for(i <= 0; i < 5; i ++){ b = (b + a) / (1 + 12 * 0 阅读全文
posted @ 2023-04-14 23:12 kxzzow 阅读(25) 评论(0) 推荐(0)
摘要: 打卡c++趣味练 6. #include<bits/stdc++.h> using namespace std; int nuidun(double a, double b, double c, double d){ double x0, f, fd, x = 1.5; do{ x0 = x; f 阅读全文
posted @ 2023-04-13 20:08 kxzzow 阅读(21) 评论(0) 推荐(0)
摘要: 打卡 c++趣味练习 4、 #include<bits/stdc++.h> using namespace std; int main(){ int i = 0, j = 0, k = 0; int flag = 1; for(i = 0; i <= 9 && flag == 1; i ++){ f 阅读全文
posted @ 2023-04-12 21:09 kxzzow 阅读(34) 评论(0) 推荐(0)
摘要: 4/10打卡 c++ 课本例题 #include<bits/stdc++.h> using namespace std; class Frac{ public: Frac(int a = 0, int b = 0 ){ for(int i = 2; i < a || i < b; i ++ ){ i 阅读全文
posted @ 2023-04-11 20:51 kxzzow 阅读(22) 评论(0) 推荐(0)
摘要: 打卡 c++趣味编程例题 #include<bits/stdc++.h> using namespace std; int main(){ int cock , hen, chicken; for(cock = 0; cock <= 20; cock ++){ for(hen = 0; hen <= 阅读全文
posted @ 2023-04-11 20:51 kxzzow 阅读(12) 评论(0) 推荐(0)
上一页 1 ··· 31 32 33 34 35