#include const string small_names[] = { "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen" }; const string ty_words[] = { "", "", "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninty" }; void say(const int n) { if (n>=0 && n<20) { print(small_names[n]); } // no matter what I do after this point, // this function is guaranteed to work perfectly // for 0 to 19 inclusive. else if (n<100) { const int dig1 = n / 10, dig2 = n % 10; print(ty_words[dig1]); if (dig2 != 0) { print("-"); say(dig2); } } // no matter what I do after this point, // this function is guaranteed to work perfectly // for 0 to 99 inclusive. else { print("I don't know how to say "); print(n); print(" yet"); } } void main() { while (true) { print("number? "); const int x = read_int(); say(x); new_line(); } print("Bye!\n"); }