#include <iostream>
#include <cmath>
using namespace std;
char pp[20][20]={"ling","yi","er","san","si","wu","liu","qi","ba","jiu","shi"};//用数组把十位和零放进去
int read(int num){//大声朗读
if(num<=10){
cout<<pp[num];
}else if(num%10==0){
cout<<pp[num/10]<<" "<<pp[10]<<endl;
}else if(num<20){
cout<<pp[10]<<" "<<pp[num%10]<<endl;
}else{
cout<<pp[num/10]<<" "<<pp[10]<<" "<<pp[num%10]<<endl;//判断
}
}
int main(){
int n;
cin>>n;//输入
read(n);
}
//我用不了格式化,我才11勿喷
【基础】1240 念数字(c++)
最新推荐文章于 2024-09-07 10:59:43 发布