日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

[0618]Tyvj1128中文大写数字

發(fā)布時(shí)間:2025/5/22 编程问答 22 豆豆
生活随笔 收集整理的這篇文章主要介紹了 [0618]Tyvj1128中文大写数字 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

模擬題,數(shù)據(jù)太弱了,完全沒有我現(xiàn)象的幾個(gè)結(jié)果。
采用遞歸打印。

#?include?<iostream>
#?include?<string.h>
using?namespace?std;
bool?large(int?a[])
{
?for?(int?i?=?5;?i?<=?8;?i++)
??if?(a[i]?!=?0)
???return?true;
?return?false;
}

int?print(int?len,?int?ch[],?int?b)
{
?if?(len?==?1)
?{
??if?(ch[len?+?b]?!=?0)
??{
???if?(ch[len?+?b?+?1]?==?0)
????cout?<<?"0";
???cout?<<?ch[len?+?b];
??}
??return?0;
?}
?if?(len?==?2)
?{
??if?(ch[len?+?b]?!=?0)
??{
???if?(ch[len?+?b?+?1]?==?0)
????cout?<<?"0";
???cout?<<?ch[len?+?b]?<<?"shi";
??}
??print(len?-?1,?ch,?b);
??return?0;
?}
?if?(len?==?3)
?{
??if?(ch[len?+?b]?!=?0)
???cout?<<?ch[len?+?b]?<<?"bai";
??print(len?-?1,?ch,?b);
??return?0;
?}
?if?(len?==?4)
?{
??if?(ch[len?+?b]?!=?0)
???cout?<<?ch[len?+?b]?<<?"qian";
??print(len?-?1,?ch,?b);
??return?0;
?}
?if?((len?>?4)?&&?(len?<?9))
?{
??print(len?-?4,?ch,?4);
??if?((ch[5]?!=?0)?||?(ch[0]?>?5)?&&?(large(ch)?==?true))
???cout?<<?"wan";
??print(4,?ch,?0);
??return?0;
?}
?if?(len?>?8)
?{
??print(len?-?8,?ch,?8);
??if?((ch[9]?!=?0)?||?(ch[0]?>?9))
???cout?<<?"yi";
??print(8,?ch,?0);
??return?0;
?}
?return?0;
}

void?rep(int?num[],?char?ch[])
{
?num[0]?=?strlen(ch);
?for?(int?i?=?num[0];?i?>=?1;?i--)
??num[i]?=?ch[num[0]?-?i]?-?48;
}

int?main()
{
?char?da[20];

?cin?>>?da;

?int?len?=?strlen(da);
?int?a[len?+?1];
?rep(a,?da);
?int?temp?=?0;
?for?(int?i?=?a[0];?i?>=?1;?i--)
??if?(a[i]?!=?0)
???temp++;
?if?(temp?!=?0)
??print(len,?a,?0);
?else
??cout?<<?"0";
?return?0;
}

轉(zhuǎn)載于:https://www.cnblogs.com/shy-/archive/2012/06/18/2553909.html

總結(jié)

以上是生活随笔為你收集整理的[0618]Tyvj1128中文大写数字的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。