| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 381 人关注过本帖
标题:结构体
取消只看楼主 加入收藏
cpuding
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2007-9-4
收藏
 问题点数:0 回复次数:0 
结构体
#include <stdio.h>
#define N 4
struct student
{
int no[6];
char name[8];
int age[4];
int score[4];
int standing[5];
int weight[5];
}stu[N];
main()
{
int i;
input(stu);
for(i=1;i<=N;i++)
{
printf("%6d%8s%4d%4d%5d%5d",stu[i].no,stu[i].name,stu[i].age,stu[i].score,stu[i].standing,stu[i].weight);
printf("\n"); 请问这个输出有什么问题,最后编译后输出的数据错
}
getch();
}
input(struct student stu[N])
{
int i;
for(i=1;i<=N;i++)
{
printf("please input data ofstudent %d\n",i);
printf("clease no:");
scanf("%d",stu[i].no);
printf("name:");
scanf("%s",stu[i].name);
printf("age:");
scanf("%d",stu[i].age);
printf("score:");
scanf("%d",stu[i].score);
printf("standing:");
scanf("%d",stu[i].standing);
printf("weight:");
scanf("%d",stu[i].weight);
}
printf("\n");
}
搜索更多相关主题的帖子: 结构体 
2007-10-09 21:53
快速回复:结构体
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.022859 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved