1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | int main() { string s; string count; int cint; int sint; int aint = 0; count = Stdio.stdin->gets(); sscanf(count, "%d", cint); while (cint-- > 0) { s = Stdio.stdin->gets(); sscanf(s, "%d", sint); aint = aint + sint; } write("%d\n", aint); return 0; } |
aW50IG1haW4oKSB7CiAgc3RyaW5nIHM7CiAgc3RyaW5nIGNvdW50OwogIGludCBjaW50OwogIGludCBzaW50OwogIGludCBhaW50ID0gMDsKCiAgY291bnQgPSBTdGRpby5zdGRpbi0+Z2V0cygpOwogIHNzY2FuZihjb3VudCwgIiVkIiwgY2ludCk7CiAgCiAgd2hpbGUgKGNpbnQtLSA+IDApIHsKCiAgICAgcyA9IFN0ZGlvLnN0ZGluLT5nZXRzKCk7CiAgICAgc3NjYW5mKHMsICIlZCIsIHNpbnQpOwogICAgIGFpbnQgPSBhaW50ICsgc2ludDsKCiAgfQoKICB3cml0ZSgiJWRcbiIsIGFpbnQpOwogIHJldHVybiAwOwp9
-
upload with new input
-
result: Success time: 0.14s memory: 10176 kB returned value: 0
5 1 2 3 4 5
15
-
result: Success time: 0.14s memory: 10176 kB returned value: 0
2 2 3
5



