C语1.计算并输出全班的平均分。 2.输出前六名学生的姓名及成绩

[复制链接]
查看11 | 回复0 | 2011-2-20 10:24:28 | 显示全部楼层 |阅读模式
#include
void main()
{
int ctr=1,i,j,t;
float sum=0,aver=0;
struct student
{
char name[20];
float grade;
}student[30]={'\0'};
for(i=1;ivoid main(){ int ctr=1,i,j; float sum=0,aver=0;struct student {char name[20];float grade; }student[30]={'\0'},t; for(i=0;i<30;i++)//改过:原来超界了 {printf("please input the %dth student's name and grade!\n",ctr++);scanf("%s%f",student.name,&stud
回复

使用道具 举报

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

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行