#include #include int main() { int value = 0; char *line = NULL; size_t line_len = 0; FILE *f = fopen("input", "r"); if (!f) { perror("input"); return 1; } while (getline(&line, &line_len, f) != -1) { long number = strtol(line, NULL, 0); value += number; } printf("%d\n", value); free(line); fclose(f); return 0; }