结构体变量的输入、输出。
时间: 1ms 内存:128M
描述:
定义一个结构体变量,输入数据,输出变量内容。
主函数如下:
int main()
{
student student1;
cin>>student1.num>>student1.name>>student1.sex>>student1.score;
cout<<student1.num<<' '<<student1.name<<' '<<student1.sex<<' '<<student1.score;
return 0;
}提交时只提交主函数以外部分
输入:
结构体变量的数据。
输出:
结构体变量各成员值。
示例输入:
1001 lihong f 89.7
示例输出:
1001 lihong f 89.7
提示:
参考答案:
解锁文章
文章评论