请问在主函数中添加DS(data-struct)合法么?另如何通过键盘初始化数组?要求如下:::

[复制链接]
查看11 | 回复1 | 2013-1-1 19:46:25 | 显示全部楼层 |阅读模式
结构体的定义要放在main函数外面。从键盘输入的时候scanf的参数列表里面不要有提示信息。我写了一个,执行通过了:#include #include structdate{int year;int month;int day;};structstu {char num[12];char name[20];char sex;int age;date birthday;};void main(){
stu student[3];
int i; for(i=0;i<3;i++)
{ scanf("%s %s %c...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行