import java.util.Scanner;
public class Main {
public static void Sum(int[][] array){
int sum = 0;
int sumA = 0;
for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
if(i==j)
sum+=array[i][j];
if(i+j==2)
sumA+=array[i][j];
}
}
System.out.println(sum+" "+sumA);
}
public static void main(String[] arg){
Scanner sc = new Scanner(System.in);
int[][] array = new int[3][3];
for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
array[i][j] = sc.nextInt();
}
}
Sum(array);
}
}
0.0分
0 人评分
简单的a+b (C语言代码)浏览:572 |
【偶数求和】 (C语言代码)浏览:597 |
C语言程序设计教程(第三版)课后习题7.1 (C语言代码)浏览:588 |
C语言程序设计教程(第三版)课后习题10.4 (C语言代码)浏览:870 |
C语言程序设计教程(第三版)课后习题6.1 (C语言代码)浏览:533 |
K-进制数 (C语言描述,蓝桥杯)浏览:907 |
C语言程序设计教程(第三版)课后习题10.3 (C语言代码)浏览:1836 |
1048题解(读入回车问题)浏览:538 |
生日日数 (C语言代码)浏览:1409 |
杨辉三角 (C语言代码)浏览:651 |