summaryrefslogtreecommitdiff
path: root/total.c
blob: 78e2f0ffe8ac580679eb33554ba1717e677f8ab2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <stdlib.h>
#include <stdio.h>

int main(int argc, char*argv[])
{
    unsigned long long tot=0;
    char s[128];

    while(fgets(s, sizeof s, stdin))
    {
	tot += strtoull(s, NULL, 0);
    }

    printf("%llu\n", tot);

    return EXIT_SUCCESS;
}