fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define Foreach(i, c) for(__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
  4. #define For(i,a,b) for(int (i)=(a);(i) < (b); ++(i))
  5. #define rof(i,a,b) for(int (i)=(a);(i) > (b); --(i))
  6. #define rep(i, c) for(auto &(i) : (c))
  7. #define x first
  8. #define y second
  9. #define pb push_back
  10. #define PB pop_back()
  11. #define iOS ios_base::sync_with_stdio(false)
  12. #define sqr(a) (((a) * (a)))
  13. #define all(a) a.begin() , a.end()
  14. #define error(x) cerr << #x << " = " << (x) <<endl
  15. #define Error(a,b) cerr<<"( "<<#a<<" , "<<#b<<" ) = ( "<<(a)<<" , "<<(b)<<" )\n";
  16. #define errop(a) cerr<<#a<<" = ( "<<((a).x)<<" , "<<((a).y)<<" )\n";
  17. #define coud(a,b) cout<<fixed << setprecision((b)) << (a)
  18. #define L(x) ((x)<<1)
  19. #define R(x) (((x)<<1)+1)
  20. #define umap unordered_map
  21. //#define max(x,y) ((x) > (y) ? (x) : (y))
  22. #define double long double
  23. typedef long long ll;
  24. typedef pair<int,int>pii;
  25. typedef vector<int> vi;
  26. typedef complex<double> point;
  27. string ls[] = {"", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"};
  28. string fr[] = {"", "", "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"};
  29. int main(){
  30. iOS;
  31. int n;
  32. cin >> n;
  33. int x = n / 10, y = n % 10;
  34. switch(n){
  35. case 0:
  36. cout << "zero" << endl;
  37. break;
  38. case 10:
  39. cout << "ten" << endl;
  40. break;
  41. case 11:
  42. cout << "eleven" << endl;
  43. break;
  44. case 12:
  45. cout << "twelve" << endl;
  46. break;
  47. case 13:
  48. cout << "thirteen" << endl;
  49. break;
  50. case 14:
  51. cout << "fourteen" << endl;
  52. break;
  53. case 15:
  54. cout << "fifteen" << endl;
  55. break;
  56. case 16:
  57. cout << "sixteen" << endl;
  58. break;
  59. case 17:
  60. cout << "seventeen" << endl;
  61. break;
  62. case 18:
  63. cout << "eighteen" << endl;
  64. break;
  65. case 19:
  66. cout << "nineteen" << endl;
  67. break;
  68. default:{
  69. if(!x)
  70. cout << ls[y] << endl;
  71. else if(!y)
  72. cout << fr[x] << endl;
  73. else
  74. cout << fr[x] << '-' << ls[y] << endl;
  75. }
  76. }
  77. }
  78.  
Runtime error #stdin #stdout 0s 3272KB
stdin
Standard input is empty
stdout
Standard output is empty