반응형
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | import java.io.*; import java.util.*; public class Solution { public static void main(String[] args) { /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ Scanner sc = new Scanner(System.in); long sum = 0; int n = sc.nextInt(); for(int i=0;i<n;i++){ sum+=sc.nextInt(); } System.out.println(sum); } } | cs |
'알고리즘 > Hackerrank' 카테고리의 다른 글
Hackerrank - Taum and B'day (0) | 2018.10.21 |
---|---|
Jumping on the Clouds (0) | 2018.10.11 |
Equalize the Array (0) | 2018.10.10 |
ACM ICPC Team (0) | 2018.10.10 |
Compare the Triplets (0) | 2018.10.09 |