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 人评分
2005年春浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:722 |
Hello, world! (C语言代码)浏览:1201 |
C语言训练-列出最简真分数序列* (C语言代码)浏览:506 |
回文串 (C语言代码)浏览:2859 |
最长单词 (C语言代码)浏览:1376 |
C语言程序设计教程(第三版)课后习题5.7 (C语言代码)浏览:575 |
C语言程序设计教程(第三版)课后习题5.7 (C语言代码)浏览:585 |
【简单计算】 (C语言代码)浏览:622 |
2004年秋浙江省计算机等级考试二级C 编程题(1) (C语言代码)浏览:506 |
C语言程序设计教程(第三版)课后习题6.9 (C语言代码)浏览:641 |