猿问
回到首页
个人中心
反馈问题
注册登录
下载APP
首页
课程
实战
体系课
手记
专栏
慕课教程
用循环语句解决问题,判断数的位数
从键盘上输入一个整数,判断是几位数,并逆序输出
踏月光
浏览 980
回答 1
1回答
望远
#include<stdio.h> void main() { int i,n; do{ printf("请输入一个正整数:"); scanf("%d",&n); if(n<=0) { printf("数据错误,请重新输入!!\n"); } }while(n<=0); printf("逆序输出:"); for(i=0;n>0;i++) { printf(" %d",n%10); n=n/10; } printf("\n这是一个%d位数\n",i); }
1
0
5
慕瓜9220888
OMSBXYVVWESNCVFCTJINHTTZQTULZIRGTAHBRPENPMFFQQHTFYVLOHGRJLKNYRHSKLKCFOOHTOXQSRBSMDBENFWZGHIWMLBIYPZZOTCLSJWGCQFVDBJAUOCVGIPWQAVLKTCJMWDTIHQIPGTDOWSATDKEYSKSBKBBMWYMPYQHUBDCXGZOFLCLAILETEBBCDSRQTDACMBQYRKBHQQCPLONKHRYOAPOKRYIGZNGFOVWWKGLKDMJGNEPNWHQNNOSGOBTGWXAULRHZPFGGXRZWMLTHEYCEMVEBYPDPDMFEOLBCGPRGZDTFGITMEUUBBZFTWYRYVIIMKNSRYZPQLQAPEBPZJNFENWTVPQGOUTCJJAXJOXFVVSJJQILDWDKULXLENMDTARQHCOWJSVVPCLNVFRUEFWPKHRHKDBIOZOBEEQPHRWPYIYBFAMHWWPIKUIKJUKHNQBBKNCANNOUEJSBOVCCSTWVUBVCDSGTIROESVZDCLOEVCCKMYHNKHOOWKXDKHYEYBACVYELMEMUDGFMKRHYMCLUKXDTOCFEFSTTAZHAJIHOEVZYQZPERBSFDWYANTKLPKTLUBYFPUPYUNUBBVFXPIHISJJMEXZIWAXOEVIAAGNHYLUXGFUCZAHZPFXOFQANVMLYVVWTMEQKZZAUUWXATVIMDJCAMFYLUABNLZRKULLFVRJCIOPWQNBUDLSMEYCHGOYQNOOQYQPCJGWEBQILARSWXBCLXMDKRQFYXWTXHRSWWFPXYFVMXPZFNYVPZALONFWJAHRZBAZGUEBESENEBIZTWAZIYVBCCDYXWFWWNXZHQFLBOPFCKNMPVMTTRYHXGTQQAHFIAZKRHRLZIRNUUBTMQJCUDARXWPSWCKIQHBSZMGKQOECKBVSAQYZNMDJCQXYPTGTMVSMPPXHLJMIPXHEYRRGHOVFMOXASMQPQCBTMBSPMTCXAZSPPGWIAJLULYIJJRAJMCJAACNPVNUBLMSUDNAABBLLJBBLIZDNFWFRCMWXXYMPODPNAKECVDWDEKWYWFVUABYINLAJPWCDDOCLRKQHBLCEPBAHBOZLTIRAHZQKKFONMGQQMLJFYDRLBVQYALEYSITGOXZFISTAYUDJYFLIJEIRKDDKRBQILATZGDKLNMBUKRBVAPOGJQNDUXAZIQBYYZVAJZEVMUVWNDMULCSWMYARAXHCWQBHGXYVVMKXCLOEVMGIQGMRVLWMTSHBUVSPZIGVEQROAHJHAHQABHBEWIHKUHOOBDVLEELLMBQKTCCJNXUGXQYFCDAAIKNFEBYZPDDVYBYXOWLRTZWCDAMDQPOVJQGHLBCKHFFZESLUMDUATVDMOXULIILXWPOUVVWXVOQTQWNHMEDCGNOISAFHGJWJQHRWVNNKAHYOXKAZJTUOKCYRNXOVLQEAAJDDVQLMVUKAXOEBTIBTAMTDPHIHAGNUVVHTCVBICDRZRXQNARRNEHQSZGNNHGMEHEUVHLLEJIJTTDFDMLUKZTAUIBAGDGPPVDJBKSJKOEJBETQUKGXMLNTCTTDODFIRYFFPVNSBEROVPCAGZWNXWWWPCODUBOIJOYYHOFMMYCSRTGRRBVDCLKUBBLLTSNDKAKVJONCVMCDDDEMOOEVPM
0
0
0
打开App,查看更多内容
随时随地看视频
慕课网APP
相关分类
C
typedef入门问题
1 回答
继续浏览精彩内容
慕课网APP
程序员的梦工厂
打开
继续