资源描述:
《c语言程序说明书》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、程序编码:#include"conio.h"main(){voidsky1();voidsky2();voidsky3();voidsky4();inta,i;system("graftabl936");textbackground(25);textcolor(10);while(1){clrscr();for(i=0;i<5;i++)printf("");printf("ttt&程序菜单&");printf("t┌─────────────────────┐");printf("t│*1.打印学号姓名,总分*│");printf(
2、"t│*2.完成成绩排序,打印表格*│");printf("t│*3.退出程序*│");printf("t└─────────────────────┘");printf("t选择1-3");textbackground(25);textcolor(10);scanf("%d",&a);switch(a){case1:sky1();getch();textbackground(10);textcolor(25);continue;case2:sky2();getch();textbackground(10);textcolor(25)
3、;continue;case3:sky4();getch();break;default:sky3();getch();textbackground(10);textcolor(25);continue;}break;}}voidsky1(){intc[5];inti,t,j,m,v;inta[5]={10101,10102,10103,10104,10105},b[5][4]={{84,88,90,65},{78,85,83,85},{70,89,85,84},{80,78,90,75},{73,88,78,82}};charC[5][18]={"小艾",
4、"缓缓","飘飘","小鼠","咪咪"};clrscr();for(i=0;i<5;i++){c[i]=0;for(j=0;j<4;j++)c[i]=c[i]+b[i][j];}for(v=0;v<5;v++)printf("");printf("tttt#成绩表#");printf("ttt┌───┬──────────┬─────┐");printf("ttt│学号│姓名│总分│");for(i=0;i<5;i++){printf("ttt├───┼──────────┼─────┤");printf("t
5、tt│%6d│",a[i]);for(m=0;m<18;m++)printf("%c",C[i][m]);printf("│%9d",c[i]);printf("│");}printf("ttt└───┴──────────┴─────┘");}voidsky2(){intc[5];inti,t,j,m,w,e,v;inta[5]={10101,10102,10103,10104,10105},b[5][4]={{84,88,90,65},{78,85,83,85},{70,89,85,84},{80,78,90,75},{73,88,78
6、,82}};charC[5][18]={"小艾","缓缓","飘飘","小鼠","咪咪"};clrscr();for(i=0;i<5;i++){c[i]=0;for(j=0;j<4;j++)c[i]=c[i]+b[i][j];}for(i=0;i<4;i++){for(j=0;j<4-i;j++)if(c[j]7、r(w=0;w<4;w++){t=b[j][w];b[j][w]=b[j+1][w];b[j+1][w]=t;}}}printf("tttt#成绩表#");printf("┌───┬──────────┬───┬───┬───┬───┬───┬──┐");printf("│学号│姓名│数学│英语│计算机│哲学│总分│名次│");for(i=0;i<5;i++){printf("├───┼──────────┼───┼───┼───┼───┼───┼──┤");printf("│%6d│",a[i]);for(m=0;m<18;m++)
8、printf("%c",C[i][m]);for(t