#include #include #include volatile int errno; void exit(int k) { process_exit(k); } void abort() { process_exit(300 + errno); } // Random generator static unsigned int rnd; void srand(unsigned int l) { rnd = l; } int rand() { rnd = rnd * 1103515245 + 12345; return (unsigned int)(rnd / 65536) % (RAND_MAX + 1); } // ASCII to int int atoi(char *s) { int r = 0; while (*s >= '0' && *s <= '9') { r *= 10; r += (*s) - '0'; s++; }; return r; }