Skip to content

Instantly share code, notes, and snippets.

@liango2
Created January 14, 2016 18:24
Show Gist options
  • Save liango2/176504593d4ad4ba981f to your computer and use it in GitHub Desktop.
Save liango2/176504593d4ad4ba981f to your computer and use it in GitHub Desktop.
A Very Big Sum
object Solution {
def main(args: Array[String]) {
val sc = new java.util.Scanner(System.in);
var n = sc.nextInt();
var arr = new Array[Int](n);
for (arr_i <- 0 to n - 1) {
arr(arr_i) = sc.nextInt();
}
println(arr.map(_.toLong).sum)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment