blob: 4f013546031ce8cfcf5105823ded476baaaf26f4 (
plain) (
tree)
|
|
#include <stdio.h>
#include <stdlib.h>
int main (void) {
char b[64];
unsigned m = 0;
unsigned n = 0;
unsigned o = 0;
unsigned s = 0;
while (!ferror(stdin) && !feof(stdin)) {
fgets(b, 64, stdin);
if (b[0] == '\n') {
if (s > m) {
o = n;
n = m;
m = s;
goto c;
}
if (s > n) {
o = n;
n = s;
goto c;
}
if (s > o) {
o = s;
goto c;
}
c:
s = 0;
} else {
s += atoi(b);
}
}
printf("%u %u %u sum %u\n", m, n, o, m+n+o);
}
|