Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Solution {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- Scanner input2 = new Scanner(System.in);
- int amount = input.nextInt();
- String num = input2.nextLine();
- String[] numbers = num.split(" ");
- input.close();
- input2.close();
- int result = 0;
- for(int i = 0; i < amount; ++i){
- int temp = Integer.parseInt(numbers[i]);
- result += temp;
- }
- System.out.println(result);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment