Created
October 18, 2017 13:18
-
-
Save pteacher/714d06afa00cf906414a13c8288f2751 to your computer and use it in GitHub Desktop.
2nd task from 1.11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.company; | |
import java.util.Scanner; | |
public class Main { | |
static Scanner in = new Scanner(System.in); | |
public static void main(String[] args) { | |
int n = in.nextInt(); | |
int[][] a = new int[n][n]; | |
for (int i = 0; i < n; i++) { | |
for (int j = 0; j < n; j++) { | |
a[i][j] = in.nextInt(); | |
} | |
} | |
int k = 0; | |
for (int i = 0; i < n; i++) { | |
for (int j = 0; j < n; j++) { | |
if (a[i][j] == a[j][i]) { | |
k++; | |
} | |
} | |
} | |
System.out.println((k == n*n) ? "yes" : "no"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment