第1个回答 推荐于2016-05-25
以前做的基本功能差不多
#include<stdio.h>
#include <stdlib.h>
int main()
{
int n,sum;
long int i;
struct student
{
char xh[20];//学号
char xb[3];//性别
char mz[10];//民族
char xm[20];//姓名
int English;
int math;
int PE;
int computer;
int C;
}student[9999];
A: system("color 5e");
printf("欢迎来到学生信息查询系统,输入1~6进行相应功能\n\n");
printf(" ★1.个人信息输入\n\n");
printf(" ★2.成绩输入\n\n");
printf(" ★3.单科成绩查询\n\n");
printf(" ★4.总分查询\n\n");
printf(" ★5.挂科科目\n\n");
printf(" ★6.安全退出\n\n");
scanf("%d",&n);
printf("请输入您的序列号1~9999:");
scanf("%ld",&i);
switch(n)
{
case 1:printf("请输入学号:");
scanf("%s",student[i].xh);
printf("请输入性别:");
scanf("%s",student[i].xb);
printf("请输入民族:");
scanf("%s",student[i].mz);
printf("请输入姓名:");
scanf("%s",student[i].xm);
goto A;
case 2:printf("请输入英语成绩:");
scanf("%d",&student[i].English);
printf("请输入数学:");
scanf("%d",&student[i].math);
printf("请输入体育:");
scanf("%d",&student[i].PE);
printf("请输入计算机:");
scanf("%d",&student[i].computer);
printf("请输入C语言:");
scanf("%d",&student[i].C);
goto A;
case 3:printf("英语:%d\n",student[i].English);
printf("数学:%d\n",student[i].math);
printf("体育:%d\n",student[i].PE);
printf("计算机:%d\n",student[i].computer);
printf("C语言:%d\n",student[i].C);
goto A;
case 4:sum=student[i].English+student[i].math+student[i].PE+student[i].computer+student[i].C;
printf("你的总成绩为:%d\n",sum); goto A;
case 5:printf("挂科科目为:\n");
if(student[i].English<60)printf("英语\n");
if(student[i].math<60)printf("数学\n");
if(student[i].PE<60)printf("体育\n");
if(student[i].computer<60)printf("计算机\n");
if(student[i].C<60)printf("C语言\n"); goto A;
case 6:exit(0);
}
return 0;
}本回答被提问者采纳