整数转换为相应的英语单词"/>
C++ 将整数转换为相应的英语单词
编写一个程序,当输入一个整数以后,可以转换成相应的英文单词输出。如: 123 转换成one hundred twenty three.
#include<iostream>
#include<string.h>
#define N 100
using namespace std;
void hansu1(char x)//1-19的英语单词
{if(x=='1') cout<<"one";else if(x=='2') cout<<"two";else if(x=='3') cout<<"three"; else if(x=='4') cout<<"four";else if(x=='5') cout<<"five";else if(x=='6') cout<<"six";else if(x=='7') cout<<"seven";else if(x=='8') cout<<"eight";else if(x=='9') cout<<"nine";}
void hansu2(char x)//10、
更多推荐
C++ 将整数转换为相应的英语单词
发布评论