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.
37 lines
782 B
37 lines
782 B
#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;
|
|
}
|
|
}
|
|
}
|
|
}
|