您好,欢迎访问三七文档
#includestdio.hchardata_1[19][10]={one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve,thirteen,forteen,fifteen,sixteen,seventeen,eighteen,ninteen};chardata_2[8][8]={twenty,thirty,forty,fifty,sixty,seventy,eighty,ninty};translation_A(longN){/*翻译千位数*/longa;if(N==0){printf(Zero\n);return;}a=N/1000;if(a!=0){translation_B(a);printf(thousand);}a=N%1000;if(a!=0)translation_B(a);}translation_B(longa){/*翻译百位数*/longb;b=a/100;if(b!=0){translation_C(b);printf(hundred);}b=a%100;if(b!=0)translation_C(b);}translation_C(longb){/*翻译十位数和个位数*/longc;if(b=19)printf(%s,data_1[b-1]);else{c=b/10;printf(%s,data_2[c-2]);c=b%10;if(c!=0)printf(%s,data_1[c-1]);}}main(){longN;printf(Pleaseinputalongegerfrom0~999999\n);scanf(%ld,&N);while(N=0&&N=999999){translation_A(N);printf(\nPleaseinputalongegerfrom0~999999\n);scanf(%ld,&N);}getche();}
本文标题:数字翻译器程序
链接地址:https://www.777doc.com/doc-2330633 .html