int atoi(const char *s); int printf(const char *s, ...); // See gcd.rs for explanation. typedef struct { int gcd, s, t; } results; results gcd(int a, int b) { int quo = a / b, rem = a % b; return (rem) ? gcd(b, rem) : (results){b, quo, 0}; // XXX all wrong } int main(int argc, char **argv) { int a = atoi(argv[1]), b = atoi(argv[2]); results r = gcd(a, b); printf("gcd(%d, %d) = (%d, %d, %d)\n", a, b, r.gcd, r.s, r.t); return 0; }