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
650 B

#include <stdio.h>
int main()
{
float board[100]={0};
int a=0,i=0;
float temp;
while(1)
{
scanf("%f",&temp);
if(a==0&&temp>10000&&temp<99999)
{
board[i*5+a]=temp;
a=a+1;
}
else
{
board[i*5+a]=temp;
a=a+1;
}
if(a==4)
{
a=0;
i=i+1;
}
if(i==3&&a==0)
{
for(int j=0;j<3;j++)
{
board[j*5+4]=board[j*5+1]+board[j*5+2]+board[j*5+3];
}
for(int j=0;j<3;j++)
{
for(int k=0;k<=4;k++)
{
if(k!=0)
{
printf("%.1f ",board[j*5+k]);
}
else printf("%.0f ",board[j*5+k]);
}
printf("\n");
}
}
}
return 0;
}