user-0 提问: 简单C语言问题，子函数到另一个子函数？

回复:
user: user-1
content: {         if (key == 6)             return;         if (key == 1 || key == 2 || key == 3 || key == 4 || key == 5)             break;         else             printf("输入错误，请重新输入!\n");     }     switch (key)     {         case 1:input(stu);          /*case 2:show(stu,num);         case 3:sort(); break;         case 4:change(); break;         case 5:del(); break;*/     } 变成了 {         if (key == 6)             return 0;         if (key == 1 || key == 2 || key == 3 || key == 4 || key == 5)         {             switch (key)             {                 case 1:input(stu);                 /*case 2:show(stu,num);                 case 3:sort(); break;                 case 4:change(); break;                 case 5:del(); break;*/             }         }         else             printf("输入错误，请重新输入!\n");     } 仔细看一下。。。

user: user-2
content: 本来就进不到menu，程序在信息录入之后会return，就代表程序结束了

user: user-0
content: 引用 1 楼 Destiny0321 的回复:#define  _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <windows.h>  typedef struct {     char name[10];     int id;     int eng;     int math;     int chi;     int sum; }Stu;  void menu()//主菜单 {     int key = 0;     printf("\t\t\t\t学生成绩管理系统\n");     printf("\t\t\t\t**1.录入信息**\n");     printf("\t\t\t\t**2.显示信息**\n");     printf("\t\t\t\t**3.成绩排序**\n");     printf("\t\t\t\t**4.成绩修改**\n");     printf("\t\t\t\t**5.成绩删除**\n");     printf("\t\t\t\t**6.退出**\n"); } void input(Stu stu[])//录入信息 {     int num,i;     printf("请输入学生人数:");     scanf("%d", &num);     for (i = 0; i < num; i++)     {         getchar();         printf("请输入姓名:");         gets(stu[i].name);         printf("请输入学号:");         scanf("%d", &stu[i].id);         printf("英语成绩:");         scanf("%d", &stu[i].eng);         printf("数学成绩:");         scanf("%d", &stu[i].math);         printf("语文成绩:");         scanf("%d", &stu[i].chi);         stu[i].sum = stu[i].eng + stu[i].math + stu[i].chi;     }     printf("\n录入成功！\n");     system("cls");     menu(); }  int main(void) {     Stu stu[50];     int key,num = 0;     menu();     printf("\t\t\t\t请选择:");     while (scanf("%d", &key))     {         if (key == 6)             return 0;         if (key == 1 || key == 2 || key == 3 || key == 4 || key == 5) 		{             switch (key) 			{ 				case 1:input(stu); 				/*case 2:show(stu,num); 				case 3:sort(); break; 				case 4:change(); break; 				case 5:del(); break;*/ 			} 		}         else             printf("输入错误，请重新输入!\n");     }     return 0; } 这个没变化啊

user: user-1
content: #define  _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <windows.h>  typedef struct {     char name[10];     int id;     int eng;     int math;     int chi;     int sum; }Stu;  void menu()//主菜单 {     int key = 0;     printf("\t\t\t\t学生成绩管理系统\n");     printf("\t\t\t\t**1.录入信息**\n");     printf("\t\t\t\t**2.显示信息**\n");     printf("\t\t\t\t**3.成绩排序**\n");     printf("\t\t\t\t**4.成绩修改**\n");     printf("\t\t\t\t**5.成绩删除**\n");     printf("\t\t\t\t**6.退出**\n"); } void input(Stu stu[])//录入信息 {     int num,i;     printf("请输入学生人数:");     scanf("%d", &num);     for (i = 0; i < num; i++)     {         getchar();         printf("请输入姓名:");         gets(stu[i].name);         printf("请输入学号:");         scanf("%d", &stu[i].id);         printf("英语成绩:");         scanf("%d", &stu[i].eng);         printf("数学成绩:");         scanf("%d", &stu[i].math);         printf("语文成绩:");         scanf("%d", &stu[i].chi);         stu[i].sum = stu[i].eng + stu[i].math + stu[i].chi;     }     printf("\n录入成功！\n");     system("cls");     menu(); }  int main(void) {     Stu stu[50];     int key,num = 0;     menu();     printf("\t\t\t\t请选择:");     while (scanf("%d", &key))     {         if (key == 6)             return 0;         if (key == 1 || key == 2 || key == 3 || key == 4 || key == 5) 		{             switch (key) 			{ 				case 1:input(stu); 				/*case 2:show(stu,num); 				case 3:sort(); break; 				case 4:change(); break; 				case 5:del(); break;*/ 			} 		}         else             printf("输入错误，请重新输入!\n");     }     return 0; }