确实简单
2026-07-31 20:27:56
发布于:浙江
3阅读
0回复
0点赞
这道题只需要用while拆数就行了
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,cnt=0;
cin>>n;
while(n>0){
cnt++;
n/=10;
}
cout<<cnt;
return 0;
}
这里空空如也
2026-07-31 20:27:56
发布于:浙江
这道题只需要用while拆数就行了
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,cnt=0;
cin>>n;
while(n>0){
cnt++;
n/=10;
}
cout<<cnt;
return 0;
}
这里空空如也
提交答案之后,这里将显示提交结果~
有帮助,赞一个