ADD file via upload

main
p3afi4g2n 5 days ago
parent 0d230c8f9a
commit 621cc0230a

@ -0,0 +1,36 @@
#include<stdio.h>
int main(){
printf(" 1.Input\n");
printf(" 2.Output\n");
printf(" 3.Order\n");
printf(" 4.Quit\n");
char a;
scanf("%c",&a);
if(a=='i'){
printf("Please input info of the three students:\n");
}else if(a=='o'){
printf("You are trying to Output info\n");
}else if(a=='m'){
printf("You are trying to Make things ordered\n");
}else if(a=='q'){
printf("You are about to Quit\n");
}else{
printf("Wrong input");
}
float num[3][4];
for(int i=0;i<3;i++){
for(int j=0;j<4;j++){
scanf("%f",&num[i][j]);
}
}
for(int i=0;i<3;i++){
float sum;
for(int j=1;j<4;j++){
sum+=num[i][j];
if(j==3){
printf("%.0f,%.1f,%.1f\n",num[i][0],sum,sum/3);
sum=0;
}
}
}
}
Loading…
Cancel
Save