代码如下所示
#include<stdio.h>
int main()
{
char s, q, o;
s = q = o = 0;
float k;
int i, j, l, m, n;
i = j = l = m = n = 0;
k = 0.0;
float e;
int a, b, c, d, f, g, h;
float s1, s2, s3, s4, s5, s6, s7;
float score[10] = { s };
char name[10] = { s };
s3 = 0;
menu:
printf("欢迎使用大学评价系统,请根据提示输入相应的信息\n");
printf("\n1.开启评价系统 2.对已输入的评分进行排名(从小到大)\n");
scanf_s("%d", &g);
if (g == 1)
goto judge;
else
goto sort;
judge:
printf("\n请输入该大学的名称");
scanf_s("%10c", &s, 10);
if (s != 0)
name[i] = s;
else
goto judge;
printf("\n请输入该大学的校友会排名");
scanf_s("%d", &a);
if (a <= 300)
s1 = 0.5;
else if (a > 300)
s1 = 0.25;
printf("\n请输入该大学的软科排名");
scanf_s("%d", &b);
if (b <= 300)
s2 = 0.5;
else if (b > 300)
s2 = 0.25;
printf("\n请输入该大学的US世界排名,如无请输0");
scanf_s("%d", &c);
if (c == 0)
s3 = 0;
else if (c >= 0 && c <= 1600)
s3 = 1;
else if (c >= 1600)
s3 = 0.5;
printf("\n请输入该大学是否坐落于省会城市");
printf("\n1.是 2.否");
scanf_s("%d", &d);
if (d == 1)
s4 = 2;
else s4 = 1;
printf("\n请输入该大学的考研率,请以小数的形式输入");
scanf_s("%f", &e);
if (e <= 0.1)
s5 = 0.5;
else s5 = 1;
printf("\n请输入该大学是一本还是二本");
printf("\n1.一本 2.二本");
scanf_s("%d", &f);
if (f == 1)
s6 = 5;
else s6 = 3;
s7 = s1 + s2 + s3 + s4 + s5 + s6;
printf("\n该大学是的综合评分是%f", s7);
score[i] = s7;
i++;
printf("\n1.回到主菜单 2.继续录入新大学的数据");
scanf_s("%d", &h);
if (h == 1)
goto menu;
else
goto judge;
sort:
for(i=0;i<9;i++)
for(j=9;j>i;j--)
if (score[i]>score[j])
{
q = name[i];
name[i] = name[j];
name[j] = q;
k = score[i];
score[i] = score[j];
score[j] = k;
}
for (i = 0; i < 10; i++)
printf("\n%c %f",name[i],score[i]);
printf("\n1.回到主菜单 2.继续录入新大学的数据");
scanf_s("%d", &h);
if (h == 1)
goto menu;
else
goto judge;
return 0;
}
```c++
```c++
最终无法成功输出汉字,求各位学长帮我看看哪里有问题

这是执行结果,应当在评分前带有大学的名称,但却没有显示