c++_将数字转换为汉字

时间:2019-05-13 08:23:57
【文件属性】:

文件名称:c++_将数字转换为汉字

文件大小:408B

文件格式:RAR

更新时间:2019-05-13 08:23:57

c++ 数字 转换 汉字

#include"iostream.h" #include"string" int main() { int nNumber; cout<<"输入一个阿拉伯数字:"; cin>>nNumber; char str[]={"零"}; switch(nNumber) { case 0: { strcpy(str,"零"); break; } case 1: { strcpy(str,"一"); break; } case 2: { strcpy(str,"二"); break; } case 3: { strcpy(str,"三"); break; } case 4: { strcpy(str,"四"); break; } case 5: { strcpy(str,"五"); break; } case 6: { strcpy(str,"六"); break; } case 7: { strcpy(str,"七"); break; } case 8: { strcpy(str,"八"); break; } case 9: { strcpy(str,"九"); break; } default: { cout<<"输入错误 ! "; return ; } } cout<


【文件预览】:
1.cpp

网友评论