Skip to content

Instantly share code, notes, and snippets.

@erikgunawan
Last active January 10, 2016 05:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erikgunawan/a7b3e9fabdb7565faa64 to your computer and use it in GitHub Desktop.
Save erikgunawan/a7b3e9fabdb7565faa64 to your computer and use it in GitHub Desktop.
[HackerRank Solutions] Warmup - Simple Array Sum
import java.util.Scanner;
/*
* HackerRank Warmup - Simple Array Sum
* @author Erik Gunawan
*/
public class SimpleArraySum {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int N = in.nextInt();
int result = 0;
for (int i=0; i < N; i++){
result += in.nextInt();
}
System.out.println(result);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment