Advertisement
chillurbrain

11.1. Города и дороги

May 25th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.35 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.     public static void main(String args[]) {
  5.         Scanner sc = new Scanner(System.in);
  6.         int n, x, s;
  7.         n = sc.nextInt();
  8.         s = 0;
  9.         for (int i = 0; i < n * n; i++) {
  10.             x = sc.nextInt();
  11.             s += x;
  12.         }
  13.         System.out.println(s / 2);
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement