fork(3) download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. string a[10] = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"};
  6. string b[10] = {"ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen"};
  7. string c[10] = {"tmp", "ten", "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"};
  8.  
  9. int main() {
  10. int n;
  11. cin >> n;
  12. if (n < 10)
  13. cout << a[n];
  14. else if (n < 20)
  15. cout << b[n % 10];
  16. else {
  17. cout << c[n / 10];
  18. if (n % 10)
  19. cout << '-' << a[n % 10];
  20. }
  21. cout << endl;
  22. }
Runtime error #stdin #stdout 0s 3276KB
stdin
Standard input is empty
stdout
Standard output is empty