0
点赞
收藏
分享

微信扫一扫

2022年12月STEMAC++中级组编程题

SPEIKE 2023-05-31 阅读 44

解析:这题可以直接通过循环除法求商得出有几位数。

#include<iostream>
using namespace std;
int main(){
    int N;
    cin>>N;
    int ans = 0;
    while(N>0){
        N /= 10;
        ans++; 
    }
    cout<<ans;
    return 0;
}
举报

相关推荐

0 条评论