输入一个4*3表,计算每一行的和。
Inut:
12个整数在4*3表中
输出:
4个整数,每一个在单行中
输入样例:
12 4 6
8 23 3
15 7 9
2 5 17
输出样例:
不知道你这个问题是否已经解决, 如果还没有解决的话:#include<stdio.h>
int main(){
int res[4];
int i,j;
int count = 0;
for(i=0;i<4;i++){
for(j=0;j<3;j++){
int temp;
scanf("%d",&temp);
count += temp;
}
res[i]=count;
count=0;
}
for(i=0;i<4;i++){
printf("%d\n",res[i]);
}
return 0;
}