猿问
用循环语句解决问题,判断数的位数
从键盘上输入一个整数,判断是几位数,并逆序输出
踏月光
浏览 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
OMSBXYVVWESNCVFCTJINHTTZQTULZIRGTAHBRPENPMFFQQHTFYVLOHGRJLKNYRHSKLKCFOOHTOXQSRBSMDBENFWZGHIWMLBIYPZZOTCLSJWGCQFVDBJAUOCVGIPWQAVLKTCJMWDTIHQIPGTDOWSATDKEYSKSBKBBMWYMPYQHUBDCXGZOFLCLAILETEBBCDSRQTDACMBQYRKBHQQCPLONKHRYOAPOKRYIGZNGFOVWWKGLKDMJGNEPNWHQNNOSGOBTGWXAULRHZPFGGXRZWMLTHEYCEMVEBYPDPDMFEOLBCGPRGZDTFGITMEUUBBZFTWYRYVIIMKNSRYZPQLQAPEBPZJNFENWTVPQGOUTCJJAXJOXFVVSJJQILDWDKULXLENMDTARQHCOWJSVVPCLNVFRUEFWPKHRHKDBIOZOBEEQPHRWPYIYBFAMHWWPIKUIKJUKHNQBBKNCANNOUEJSBOVCCSTWVUBVCDSGTIROESVZDCLOEVCCKMYHNKHOOWKXDKHYEYBACVYELMEMUDGFMKRHYMCLUKXDTOCFEFSTTAZHAJIHOEVZYQZPERBSFDWYANTKLPKTLUBYFPUPYUNUBBVFXPIHISJJMEXZIWAXOEVIAAGNHYLUXGFUCZAHZPFXOFQANVMLYVVWTMEQKZZAUUWXATVIMDJCAMFYLUABNLZRKULLFVRJCIOPWQNBUDLSMEYCHGOYQNOOQYQPCJGWEBQILARSWXBCLXMDKRQFYXWTXHRSWWFPXYFVMXPZFNYVPZALONFWJAHRZBAZGUEBESENEBIZTWAZIYVBCCDYXWFWWNXZHQFLBOPFCKNMPVMTTRY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