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.

28 lines
433 B

#include<stdio.h>
int main(){
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=0;
for(int j=0;j<=3;j++){
if(j==0){
printf("%.0f ",num[i][j]);
}else{
printf("%.1f ",num[i][j]);
if(j>=1){
sum+=num[i][j];
}
if(j==3){
printf("%.1f \n",sum);
sum=0;
}
}
}
}
return 0;
}