Advertisement
Mishakis

SumNumbers

Aug 2nd, 2017
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.47 KB | None | 0 0
  1. package com.company;
  2.  
  3. import com.sun.org.apache.xpath.internal.SourceTree;
  4.  
  5. import java.util.Scanner;
  6.  
  7. public class Main {
  8.  
  9.     public static void main(String[] args) {
  10.         Scanner scanner = new Scanner(System.in);
  11.  
  12.         int n = Integer.parseInt(scanner.nextLine());
  13.         int sum=0;
  14.  
  15.         for (int i = 0; i <n ; i++) {
  16.             int a = Integer.parseInt(scanner.nextLine());
  17.             sum += a;
  18.         }
  19.         System.out.println(sum);
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement