2017年12月25日

摘要: #include using namespace std; class Time{ public: int hour; int minute; int sec; }; void set_time(Time&t){ cin>>t.hour; cin>>t.minute; cin>>t.sec; } void sh... 阅读全文
posted @ 2017-12-25 21:33 三叶癌 阅读(576) 评论(0) 推荐(0) 编辑

2017年12月17日

摘要: 候选人得票的统计程序。有3个候选人,最终只有1人当选 领导。现有10人参加投票,从键盘先后输入10个人所投候选人名字,要求最后输出候选人得票结果。 阅读全文
posted @ 2017-12-17 19:13 三叶癌 阅读(388) 评论(0) 推荐(0) 编辑
摘要: 例题7.1 声明学生结构体Student 定义两个结构体变量student1和student2 成员包括学号 姓名 性别 出生日期 成绩 学生1初始化 把学生1复制给学生2 输出学生2 阅读全文
posted @ 2017-12-17 18:12 三叶癌 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 定义一个字符串变量并初始化,输出 指向字符串的字符指针 阅读全文
posted @ 2017-12-17 17:28 三叶癌 阅读(503) 评论(0) 推荐(0) 编辑

2017年12月11日

摘要: #include using namespace std; int main(){ int a[8]; for(int i=0;i>a[i]; } for(int i=0;i using namespace std; int main(){ int a[10]; for(int i=0;i>*(a+i); cout<<endl;... 阅读全文
posted @ 2017-12-11 21:12 三叶癌 阅读(397) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; void compare(int a,int b){ int rand; if(a>x>>y; compare(x,y); } #include using namespace std; int main(){ int x,y,*a,*b,*p; cin>>x>>y; a=&x;... 阅读全文
posted @ 2017-12-11 20:39 三叶癌 阅读(90) 评论(0) 推荐(0) 编辑

2017年11月27日

摘要: #include using namespace std; int main(){ int array[3][4]={{1,46,98,-4}, {45,22,-75,0}, {456,498,35,4}}; int unknow=array[0][0]; int h=0; int l=0; for... 阅读全文
posted @ 2017-11-27 21:34 三叶癌 阅读(426) 评论(0) 推荐(0) 编辑

2017年11月20日

摘要: 使用一位数组解决 1 1 2 3 5 8 13 数列问题 阅读全文
posted @ 2017-11-20 20:20 三叶癌 阅读(118) 评论(0) 推荐(0) 编辑

2017年11月16日

摘要: #include using namespace std; int main(){ int arr[10]={6,98,498,56,43,646,894,46,8,89}; for (int i=0;iarr[j+1]){ int re; re=arr[j]; ... 阅读全文
posted @ 2017-11-16 20:42 三叶癌 阅读(88) 评论(0) 推荐(0) 编辑

2017年11月9日

摘要: #include using namespace std; template T max(T x ,T y,T z){ if(z>x) x=z; if(y>x) x=y; return x; } int main(){ int a,b,c,m; cin>>a>>b>>c; m=max(a,b,c); cout>ac>>bc... 阅读全文
posted @ 2017-11-09 20:49 三叶癌 阅读(120) 评论(0) 推荐(0) 编辑

导航