#include <iostream>
using namespace std;
int main() {
int a[101] = { 0 };//存储输入数据
int i = 0;//后面循环使用
int sum = 0;//数据各位之和
int c;
int b[10] = { 0 };//
while ((c = getchar()) != '\n') {//逐个输入
a[i++] = c - '0';
}
for (--i; i >= 0; --i) sum += a[i];
++i;
while (sum) {
b[i++] = sum % 10;
sum /= 10;
}
for (--i; i >= 0; --i) {
switch (b[i]) {
case 0:cout << "ling";
break;
case 1:cout << "yi";
break;
case 2:cout << "er";
break;
case 3:cout << "san";
break;
case 4:cout << "si";
break;
case 5:cout << "wu";
break;
case 6:cout << "liu";
break;
case 7:cout << "qi";
break;
case 8:cout << "ba";
break;
default:cout << "jiu";
break;
}
cout << " ";
}
}
相关文章
- 12-01PAT (Basic Level) Practise (中文)-1020. 月饼 (25)
- 12-01PAT 乙级 (Basic Level) Practice (中文)1058
- 12-01PAT (Basic Level) Practice (中文)1023 组个最小数 (20 分)
- 12-01PAT (Basic Level) Practice (中文)1023 组个最小数 (20 分) (排序)
- 12-01PAT (Basic Level) Practice 1016
- 12-01PAT(Basic Level) Practice : 1087 有多少不同的值 (20分)
- 12-01PAT (Basic Level) Practice (中文)1008 数组元素循环右移问题
- 12-01PAT (Basic Level) Practice (中文)1071 小赌怡情 (15 分)
- 12-011002 写出这个数 (20 分)—PAT (Basic Level) Practice (中文)
- 12-01PAT_Basic Level_Practice_1013 (20)