ADD file via upload

main
pu7icvtwj 1 day ago
parent c1cee2a5df
commit 8a1b1f861e

@ -0,0 +1,46 @@
#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);
}
}
Loading…
Cancel
Save