- 博客(5)
- 收藏
- 关注
转载 结构体数组 候选人得票的统计程序
候选人得票的统计程序。有3个候选人,最终只有1人当选#include <iostream>#include <string.h>using namespace std;struct candiate{ string name; int num;};int main(){ candiate lead...
2017-12-18 20:27:00
435
转载 应用结构体完成结构体的输出
例题7.1 声明学生结构体Student定义两个结构体变量student1和student2成员包括学号 姓名 性别 出生日期 成绩学生1初始化把学生1复制给学生2输出学生2#include<iostream>#include <string.h>using namespace std;struct date{ ...
2017-12-18 20:24:00
258
转载 定义一个字符数组并初始化,然后输出其中字符串
#include<iostream>using namespace std;int main(){ char str[]="Winer Winer Chicken Dinner"; cout<<str<<endl; int a[8]={1,864,89,46,48,35,24}; for(int i=...
2017-12-18 20:22:00
1281
转载 用三种方法输出数组中的全部元素
#include <iostream>using namespace std; int main(){ int a[8]; for(int i=0;i<8;i++){ cin>>a[i]; } for(int i=0;i<8;i++){ cout<&...
2017-12-18 20:14:00
1064
转载 指针变量
#include<iostream>using namespace std;void compare(int a,int b){ int rand; if(a<b){ rand=a; a=b; b=rand; } cout<<a<<' '&l...
2017-12-18 20:11:00
86
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人