解题思路:
注意事项:
参考代码:
import java.util.Scanner;
import java.text.DecimalFormat;
public class Main {
public static void sum() {
Scanner sc = new Scanner(System.in);
while (sc.hasNext()) {
int[][] a = new int[3][3];
for(int i=0;i<3;i++) {
for(int j=0;j<3;j++) {
a[i][j]=sc.nextInt();
}
}
int c=a[0][0]+a[1][1]+a[2][2];
int d=a[0][2]+a[1][1]+a[2][0];
System.out.print(c+" "+d);
}
}
public static void main(String[] args) {
sum();
}
}
0.0分
1 人评分
输出九九乘法表 (C语言代码)浏览:572 |
C语言训练-自由落体问题 (C语言代码)浏览:1769 |
C语言程序设计教程(第三版)课后习题6.10 (C语言代码)浏览:818 |
蛇行矩阵 (C语言代码)浏览:786 |
C语言训练-求PI* (C语言代码)浏览:631 |
【偶数求和】 (C语言代码)浏览:583 |
用筛法求之N内的素数。 (C语言代码)浏览:680 |
1009题解浏览:793 |
1128题解(返回值为数组的情况)浏览:565 |
矩阵乘方 (C语言代码)浏览:1072 |