You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.5 KiB
47 lines
1.5 KiB
1 week ago
|
#include<stdio.h>
|
||
|
int main(){
|
||
|
int i,j;
|
||
|
char c;
|
||
|
for(i=0;i<30;i++){
|
||
|
printf(" ");
|
||
|
}
|
||
|
printf("1.Input\n");
|
||
|
for(i=0;i<30;i++){
|
||
|
printf(" ");
|
||
|
}
|
||
|
printf("2.Output\n");
|
||
|
for(i=0;i<30;i++){
|
||
|
printf(" ");
|
||
|
}
|
||
|
printf("3.Order\n");
|
||
|
for(i=0;i<30;i++){
|
||
|
printf(" ");
|
||
|
}
|
||
|
printf("4.Quit\n");
|
||
|
scanf("%c",&c);
|
||
|
switch(c){
|
||
|
case('i'):printf("You are trying to Input info");break;
|
||
|
case('o'):printf("You are trying to Output info");break;
|
||
|
case('m'):printf("You are trying to Make things ordered");break;
|
||
|
case('q'):printf("You are about to Quit");break;
|
||
|
default:printf("Wrong input");break;
|
||
|
}
|
||
|
{struct student
|
||
|
{int num;
|
||
|
float grade_m;
|
||
|
float grade_p;
|
||
|
float grade_e;
|
||
|
} student1,student2,student3;
|
||
|
|
||
|
|
||
|
scanf("%d%f%f%f",&student1.num,&student1.grade_m,&student1.grade_p,&student1.grade_e);
|
||
|
scanf("%d%f%f%f",&student2.num,&student2.grade_m,&student2.grade_p,&student2.grade_e);
|
||
|
scanf("%d%f%f%f",&student3.num,&student3.grade_m,&student3.grade_p,&student3.grade_e);
|
||
|
printf("%d %.1f %.1f %.1f %.1f",student1.num,student1.grade_m,student1.grade_p,student1.grade_e,student1.grade_m+student1.grade_p+student1.grade_e);
|
||
|
printf("%d %.1f %.1f %.1f %.1f",student2.num,student2.grade_m,student2.grade_p,student2.grade_e,student2.grade_m+student2.grade_p+student2.grade_e);
|
||
|
printf("%d %.1f %.1f %.1f %.1f",student3.num,student3.grade_m,student3.grade_p,student3.grade_e,student3.grade_m+student3.grade_p+student3.grade_e);
|
||
|
|
||
|
|
||
|
}
|
||
|
}
|