Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Enter your code herepackage com.company;
- /**
- * Created by Alex on 28.02.2015.
- */
- public class MasiveDual {
- public static boolean Check(int a) {
- if (a != 0)
- return true;
- else
- return false;
- }
- public static void main(String[] args) {
- int m[][] = new int[7][7];
- int f = 1;
- for (int i = 0; i < m.length; i++) {
- for (int j = 0; j < m[i].length; j++) {
- if (i == j) {
- m[i][j] = 0;
- f++;
- } else if (j == (m.length-1) - i) {
- m[i][j] = 0;
- f++;
- } else {
- m[i][j] = f;
- f++;
- }
- }
- }
- for (int i = 0; i < m.length; i++) {
- System.out.println();
- for (int j = 0; j < m[i].length; j++) {
- System.out.print(m[i][j] + " ");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement