Advertisement
Guest User

Untitled

a guest
Apr 7th, 2020
163
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.  
  5.     public static void main(String[] args) throws Exception {
  6.        
  7.         Scanner wczytanie2 = new Scanner(System.in);
  8.  
  9.         int[] tab1 = new int[5];
  10.         int suma=0;
  11.        
  12.         for (int e = 0; e < tab1.length; e++) {
  13.             tab1[e] = wczytanie2.nextInt();
  14.             suma+=tab1[e];
  15.         }
  16.        
  17.         System.out.println(suma);
  18.  
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement