摘要: #include<bits/stdc++.h>using namespace std;int main(){ int a,i,j; cin>>a; int b[a]; for(j=0;j<a;j++) { cin>>b[j]; } for(i=0;i<a;i++) { if(b[i]%2==0) { 阅读全文
posted @ 2023-05-20 22:01 ruangong 阅读(12) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; class Dog { private: int weight,age; public: Dog(int w,int a):weight(w),age(a) { } int getw() { return we 阅读全文
posted @ 2023-05-16 19:10 ruangong 阅读(139) 评论(0) 推荐(0)
摘要: 以上是朋友圈中一奇葩贴:“2月14情人节了,我决定造福大家。第2个赞和第14个赞的,我介绍你俩认识…………咱三吃饭…你俩请…”。现给出此贴下点赞的朋友名单,请你找出那两位要请客的倒霉蛋。 输入格式: 输入按照点赞的先后顺序给出不知道多少个点赞的人名,每个人名占一行,为不超过10个英文字母的非空单词, 阅读全文
posted @ 2023-05-09 20:09 ruangong 阅读(45) 评论(0) 推荐(0)
摘要: 1、复数类Complex有两个数据成员:a和b, 分别代表复数的实部和虚部,并有若干构造函数和一个重载-(减号,用于计算两个复数的距离)的成员函数。 要求设计一个函数模板 template < class T > double dist(T a, T b) 对int,float,Complex或者其 阅读全文
posted @ 2023-05-05 13:06 ruangong 阅读(52) 评论(0) 推荐(0)
摘要: template <class T> class MyArray { private: int size; T *data; public: MyArray(int s) { size=s; data=new T[size]; } void sort() { int i,j; T t; for(i= 阅读全文
posted @ 2023-05-04 20:09 ruangong 阅读(28) 评论(0) 推荐(0)
摘要: #include<iostream>#include<string>using namespace std;int main(){ string a[10]={"ling","yi","er","san","si","wu","liu","qi", "ba","jiu"}; int b[20]; / 阅读全文
posted @ 2023-04-27 22:22 ruangong 阅读(19) 评论(0) 推荐(0)
摘要: #include<iostream>using namespace std;class Time{ private: int min,hour; public: Time(int a=0,int b=0) { min=b; hour=a; } int hu() { int hu=hour*60+mi 阅读全文
posted @ 2023-04-21 10:58 ruangong 阅读(40) 评论(0) 推荐(0)
摘要: 1.class Car:public Vehicle{ private: int zai,zhong; public: Car(string NO,int z,int l):Vehicle(NO),zai(z),zhong(l) {} int fee() { return zai*8+zhong*2 阅读全文
posted @ 2023-04-15 22:03 ruangong 阅读(30) 评论(0) 推荐(0)