题目:给一个不多于 5 位的正整数,要求:一、求它是几位数,二、逆序打印出各位数字。
#include <stdio.h>
int main(){
int n=12345,s=0;
while(n){
printf("%d",n%10);
n/=10;
s++;
}
return 0;
}
题目:给一个不多于 5 位的正整数,要求:一、求它是几位数,二、逆序打印出各位数字。
#include <stdio.h>
int main(){
int n=12345,s=0;
while(n){
printf("%d",n%10);
n/=10;
s++;
}
return 0;
}