OI-Codes/判断正整数位数.cpp
2023-08-23 21:52:51 +08:00

19 lines
172 B
C++

#include <iostream>
using namespace std;
int main(){
int a,b=0;
cin >>a;
if(a==0){
cout <<"1";
return 0;
}
while(a){
a/=10;
b++;
}
cout <<b;
return 0;
}