Advertisement
borkins

04. Sum Numbers

Mar 30th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.51 KB | None | 0 0
  1. /**
  2.  * Project: Loops - created by borkins on 2017-03-29.
  3.  */
  4.  
  5. import java.util.Scanner;
  6.  
  7. public class _04_SumNumbers
  8. {
  9.     public static void main(String[] args)
  10.     {
  11.         Scanner console = new Scanner(System.in);
  12.        
  13.         int numCount = Integer.parseInt(console.nextLine());
  14.        
  15.         int sum = 0;
  16.        
  17.         for (int i = 0; i < numCount; i++)
  18.         {
  19.             sum += Integer.parseInt(console.nextLine());
  20.         }
  21.    
  22.         System.out.println(sum);
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement