1000至10000的英文数字

2024-11-02 18:26:16
推荐回答(2个)
回答1:

#include
using namespace std;
void trans999(int n);
int main()
{
int i;
cout<<"please input a integer:";
cin>>i;
if(i==0)cout<<"zero";
int thousand=i/1000;
i=i%1000;
if(thousand)
{
trans999(thousand);
cout<<" thousand ";
}
trans999(i);
return 0;
}
void trans999(int n)
{
static char *digit[10]=
{" ","one","two","three","four","five","six","seven","eight","nine"};
static char *teens[10]=
{"ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eightteen","nineteen"};
static char*ties[10]=
{" "," ","twenty","thirty","fourty","fifty","sixty","seventy","eighty","ninety"};
n=n%1000;
int i=n/100;
if(i)cout< n=n%100;
i=n/10;
int j=n%10;
if(i>1)
cout< else if(i)
cout< else cout<}

回答2:

one thousand, one thousand and one, one thousand and two,......,one thousand and one hunred,one thousand and one hunred and one,.....,two thousand,two thousand and one,......,ten thousand