Created
May 15, 2016 03:24
-
-
Save TheoKlein/eb13617774b26ca2ddae0eabe6f9ca21 to your computer and use it in GitHub Desktop.
ZeroJudge d392
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <string.h> | |
| #include <stdlib.h> | |
| int main() { | |
| char input[100000]; | |
| while(gets(input) != NULL){ | |
| long int sum = 0; | |
| char *ptr; | |
| ptr = strtok(input , " "); | |
| while(ptr != NULL){ | |
| sum += atoi(ptr); | |
| ptr = strtok(NULL , " "); | |
| } | |
| printf("%ld\n",sum); | |
| } | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment