摘要: #include <bits/stdc++.h>using namespace std;template<class T>class AAA { T a, b; public: AAA(T _a, T _b): a(_a), b(_b) {}; T sum() { return a + b; } T 阅读全文
posted @ 2023-05-05 10:31 mo寒流xing 阅读(25) 评论(0) 推荐(0)
摘要: 模板与类(对象数组) #include<bits/stdc++.h>using namespace std;template<class T>T maxn(T x[],int len){ int i=1; T max=x[0]; for(i;i<len;i++) { if(max<x[i]) max 阅读全文
posted @ 2023-05-04 21:48 mo寒流xing 阅读(25) 评论(0) 推荐(0)
摘要: 实验一:复数类及函数模板(switch语句) #include<bits/stdc++.h>using namespace std; class Complex{ private: int a,b; public: Complex(int _a,int _b):a(_a),b(_b){}; doub 阅读全文
posted @ 2023-05-03 19:53 mo寒流xing 阅读(45) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h>using namespace std;typedef struct { string name;}Name;int main(){ Name num[1000]; int i=0; while(1){ cin>>num[i].name; if(num[ 阅读全文
posted @ 2023-04-27 23:27 mo寒流xing 阅读(54) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h>using namespace std;typedef struct { string id;//16位的数字 int jihao; int weihao;}STD;int main(){ int i; cin>>i; STD data[i]; for( 阅读全文
posted @ 2023-04-21 21:33 mo寒流xing 阅读(27) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> #include<string.h>using namespace std;#define maxlen 100 //表的最大长度 typedef struct{ int key; char name[20]; int age;} Data;//节点的 阅读全文
posted @ 2023-04-18 20:55 mo寒流xing 阅读(26) 评论(0) 推荐(0)
摘要: #include<iostream>#include<string>using namespace std;#include<bits/stdc++.h> #define maxlen 100 //表的最大长度 typedef struct{ char key[10]; char name[20]; 阅读全文
posted @ 2023-04-17 20:45 mo寒流xing 阅读(26) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h>using namespace std;class Shape{ public: virtual double area()=0; ~Shape(){};};class Rectangle:public Shape{ private: double wi 阅读全文
posted @ 2023-04-15 21:57 mo寒流xing 阅读(43) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h>using namespace std;int main(){ int a=39; int b=39; cout<<a<<endl<<b<<endl; a++; ++b; cout<<"one year later...."<<endl; cout<<" 阅读全文
posted @ 2023-04-14 21:36 mo寒流xing 阅读(19) 评论(0) 推荐(0)