#include <stdio.h>
#include <stdlib.h>

#define BUF_LENGTH 16
long get_number() {
    char buf[BUF_LENGTH];
    int i = -1;
    do {
        i++;
        fread(buf + i, 1, 1, stdin);
    } while (buf[i] != '\n');
    buf[i] = '\0';
    return strtoul(buf, NULL, 0);
}

void success(long num) {
    printf("You did it!! %ld was the number!\n", num);
    exit(0);
}

void failure(long num) {
    printf("%ld was not the number!\n", num);
    exit(0);
}

int x(int x) {
    return x;
}

void check() {
    printf("What number am I thinking of? ");
    long input = get_number();
    if (input == 1337) {
        success(input);
    }
    else {
        failure(input);
    }
}


int main(int argc, char *argv[]) {
    check();
    return x(50);
}
