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 人评分
【明明的随机数】 (C++代码)浏览:779 |
回文数(一) (C语言代码)浏览:728 |
Pascal三角 (C语言代码)格式错误浏览:516 |
成绩转换 (C语言代码)浏览:1005 |
C语言程序设计教程(第三版)课后习题4.9 (C语言代码)浏览:377 |
简单的a+b (C语言代码)浏览:626 |
C语言程序设计教程(第三版)课后习题10.2 (C语言代码)浏览:678 |
神奇的fans (C语言代码)浏览:973 |
字符删除 (C语言代码)浏览:713 |
判定字符位置 (C++代码)浏览:666 |