#include <stdarg.h>
#include <math.h>

static int sum_ints(int count, ...) {
    va_list args;
    va_start(args, count);
    int total = 0;
    int i;
    for (i = 0; i < count; i++) {
        total += va_arg(args, int);
    }
    va_end(args);
    return total;
}

int main(void) {
    int r = sum_ints(4, 10, 20, 30, 40);
    return r == 100 ? 0 : 1;
}
