【链接】 我是链接,点我呀:)
【题意】
【题解】
模拟题【代码】
#include <bits/stdc++.h>
using namespace std;
map <int,string> mmap;
int main(){
#ifdef LOCAL_DEFINE
freopen("rush_in.txt", "rt", stdin);
#endif
mmap[0] = "zero";
mmap[1] = "one";
mmap[2] = "two";
mmap[3] = "three";
mmap[4] = "four";
mmap[5] = "five";
mmap[6] = "six"; mmap[8] = "eight"; mmap[9] = "nine";
mmap[7] = "seven";
mmap[10] = "ten";
mmap[11] = "eleven";
mmap[12] = "twelve";
mmap[13] = "thirteen";
mmap[14] = "fourteen";
mmap[15] = "fifteen";
mmap[16] = "sixteen";
mmap[17] = "seventeen";
mmap[18] = "eighteen";
mmap[19] = "nineteen";
mmap[20] ="twenty";
mmap[30] = "thirty";
mmap[40] = "forty";
mmap[50] = "fifty";
mmap[60] = "sixty";
mmap[70] = "seventy";
mmap[80] = "eighty";
mmap[90] = "ninety";
for (int i = 2;i <= 9;i++) {
int temp = i*10;
for (int j = 1;j <= 9;j++){
mmap[temp+j] = mmap[temp]+"-"+mmap[j];
}
}
int n;
scanf("%d",&n);
cout << mmap[n]<<endl;
return 0;
}