user-0 提问: 求大神指点

回复:
user: user-1
content: printf("3.成绩查询。\n);这里少了个双引号 printf("3.成绩查询。\n");

user: user-1
content: 界面简单啊  void Menu() {     printf("------ 学生成绩管理系统 ------\n");     printf("1.成绩录入。\n");     printf("2.成绩输出。\n");     printf("3.成绩查询。\n);     printf("4.退出\n");     printf("输入选项："); }  在main函数中加入：  int main() {     int choice;     Menu();     scanf("%d", &choice);     switch(choice)     {         case 1:             //调用相应的函数             break;        case 2:             //调用相应的函数             break;         case 3:              //调用相应的函数             break;         case 4:             exit(0);             break;         default:             printf("输入选项错误，重新输入");             break;        } }  自己参照修改吧

user: user-0
content: 引用 1 楼 user-1的回复:刚好有些闲时间，顺手写了下，供参考  #define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdlib.h> #define N 100  typedef struct student {     int ID;     char name[20];     double score; }Student;  //录入信息 void InputStudent(Student *stu, int n) {     int i;     for (i = 0; i < n; i++)     {         printf("输入第%d个学生的信息：\n", i + 1);         scanf("%d%s%lf", &stu[i].ID, stu[i].name, &stu[i].score);     } }  //计算总分 double TotalSocre(Student *stu, int n) {     double sum = 0.0;     int i;     for (i = 0; i < n; i++)     {         sum += stu[i].score;     }     return sum; }  //输出 void PrintStudent(Student *stu, int n) {     int i;     printf("学号\t姓名\t成绩\n");     for (i = 0; i < n; i++)     {         printf("%d\t%s\t%.2f\n", stu[i].ID, stu[i].name, stu[i].score);     } }  //排序 void SortStudent(Student *stu, int n) {     int i, j;     Student tmp = { 0 };     for (i = 0; i < n; i++)     {         for (j = 0; j < n - i - 1; j++)         {             if (stu[j].score < stu[j + 1].score)             {                 tmp = stu[j];                 stu[j] = stu[j + 1];                 stu[j + 1] = tmp;             }         }     } }  //按学号查询 void QueryScore(Student *stu, int n) {     int i, tmp;     printf("输入要查询的学号：\n");     scanf("%d", &tmp);     for (i = 0; i < n; i++)     {         if (stu[i].ID == tmp)         {             printf("学号\t姓名\t成绩\n");             printf("%d\t%s\t%.2f\n", stu[i].ID, stu[i].name, stu[i].score);             return;         }     }     printf("学号为%d的学生不存在！\n", tmp); }  int main() {     int n;     double sum, avge;     Student s[N] = { 0 };      printf("输入学生人数：\n");     scanf("%d", &n);     InputStudent(s, n);     sum = TotalSocre(s, n);     avge = sum / n;      printf("\n--------------------\n");     PrintStudent(s, n);     printf("\n--------------------\n");          printf("总分：%.2f  平均分：%.2f\n", sum, avge);      printf("\n--------------------\n");     SortStudent(s, n);     PrintStudent(s, n);     printf("\n--------------------\n");      QueryScore(s, n);  	system("pause"); 	return 0; }  大佬大佬，，要求有用户界面能帮我写写吗求求了

user: user-1
content: 刚好有些闲时间，顺手写了下，供参考  #define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdlib.h> #define N 100  typedef struct student {     int ID;     char name[20];     double score; }Student;  //录入信息 void InputStudent(Student *stu, int n) {     int i;     for (i = 0; i < n; i++)     {         printf("输入第%d个学生的信息：\n", i + 1);         scanf("%d%s%lf", &stu[i].ID, stu[i].name, &stu[i].score);     } }  //计算总分 double TotalSocre(Student *stu, int n) {     double sum = 0.0;     int i;     for (i = 0; i < n; i++)     {         sum += stu[i].score;     }     return sum; }  //输出 void PrintStudent(Student *stu, int n) {     int i;     printf("学号\t姓名\t成绩\n");     for (i = 0; i < n; i++)     {         printf("%d\t%s\t%.2f\n", stu[i].ID, stu[i].name, stu[i].score);     } }  //排序 void SortStudent(Student *stu, int n) {     int i, j;     Student tmp = { 0 };     for (i = 0; i < n; i++)     {         for (j = 0; j < n - i - 1; j++)         {             if (stu[j].score < stu[j + 1].score)             {                 tmp = stu[j];                 stu[j] = stu[j + 1];                 stu[j + 1] = tmp;             }         }     } }  //按学号查询 void QueryScore(Student *stu, int n) {     int i, tmp;     printf("输入要查询的学号：\n");     scanf("%d", &tmp);     for (i = 0; i < n; i++)     {         if (stu[i].ID == tmp)         {             printf("学号\t姓名\t成绩\n");             printf("%d\t%s\t%.2f\n", stu[i].ID, stu[i].name, stu[i].score);             return;         }     }     printf("学号为%d的学生不存在！\n", tmp); }  int main() {     int n;     double sum, avge;     Student s[N] = { 0 };      printf("输入学生人数：\n");     scanf("%d", &n);     InputStudent(s, n);     sum = TotalSocre(s, n);     avge = sum / n;      printf("\n--------------------\n");     PrintStudent(s, n);     printf("\n--------------------\n");          printf("总分：%.2f  平均分：%.2f\n", sum, avge);      printf("\n--------------------\n");     SortStudent(s, n);     PrintStudent(s, n);     printf("\n--------------------\n");      QueryScore(s, n);  	system("pause"); 	return 0; }