标签:[] bsp dia int input nal include ++ 程序
1 2 3
1 1 1
3 2 1
3 7
1 #include <stdio.h> 2 3 int main(int argc, char const *argv[]) 4 { 5 int a[3][3], i, j; 6 int diagonal1 = 0, diagonal2 = 0; 7 8 // input 9 for(i = 0; i < 3; i++) 10 { 11 for(j = 0; j < 3; j++) 12 { 13 scanf("%d", &a[i][j]); 14 } 15 } 16 17 diagonal1 = a[0][0] + a[1][1] +a[2][2]; 18 diagonal2 = a[2][0] + a[1][1] +a[0][2]; 19 20 printf("%d %d\n", diagonal1, diagonal2); 21 22 return 0; 23 }
标签:[] bsp dia int input nal include ++ 程序
原文地址:http://www.cnblogs.com/hello-lijj/p/7843423.html