解题思路:
注意事项:
参考代码:
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语言程序设计教程(第三版)课后习题8.6 (C语言代码)浏览:589 |
用筛法求之N内的素数。 (C语言代码)浏览:705 |
C语言程序设计教程(第三版)课后习题4.9 (C语言代码)浏览:583 |
printf基础练习2 (C语言代码)浏览:539 |
字符逆序 (C语言代码)浏览:669 |
C语言程序设计教程(第三版)课后习题8.4 (C语言代码)浏览:580 |
C语言程序设计教程(第三版)课后习题5.6 (C语言代码)浏览:546 |
C语言程序设计教程(第三版)课后习题7.4 (C语言代码)浏览:3252 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:452 |
C语言训练-自由落体问题 (C语言代码)浏览:631 |