各位大哥 我是一个刚接触c语言的小白 现在有个问题问问各位的大佬
#include "stdio.h"#define SIZE 10
int main(void)
{
int i = 0,k = 0;
int a = 0,b = 0;
int fScore[SIZE];
int zf;
while(1)
{
printf("输入1为成绩录入\t输入2为成绩删除\t输入3为成绩查询\t输入4为成绩排序\t输入5为成绩插入\t输入0为退出\n");
scanf("%d",&i);
switch(i)
{
case 1:
printf("请输入成绩\n");
break;
case 2:
printf("输入你想要删除的成绩的编号\n");
scanf("%d",&a);
break;
case 3:
printf("请输入你要查询的编号\n");
scanf("%d",&b);
break;
case 4:
printf("排列为降序\n");
break;
case 5:
printf("\n");
break;
default:
printf("退出");
}
if(i==1)
{
for(k=0;k<SIZE;k++)
scanf("%d",&fScore[k]);
for(k=0;k<SIZE;k++)//可删
printf("%d\n",fScore[k]);//可删
}
else if(i==2)
{
a=a-1;
fScore[a]=0;
for(k=0;k<SIZE;k++)
printf("%d\n",fScore[k]);
}
else if(i==3)
{
b=b-1;
printf("%d\n",fScore[b]);
}
else if(i==4)
{
if(fScore[9]>fScore[8]){zf=fScore[9];}
else if(zf<fScore[7]){zf=fScore[7];}
else if(zf<fScore[6]){zf=fScore[6];}
else if(zf<fScore[5]){zf=fScore[5];}
else if(zf<fScore[4]){zf=fScore[4];}
else if(zf<fScore[3]){zf=fScore[3];}
else if(zf<fScore[2]){zf=fScore[2];}
else if(zf<fScore[1]){zf=fScore[1];}
else if(zf<fScore[0]){zf=fScore[0];}
printf("%d\n",zf);
}
else if(i==5)
{
}
else
return 0;
}
return 0;
}
这个排序和插入 不会 请各位大佬版帮我