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