top1编程
← 返回题目
题解

【入门】几位数

1 条题解

  • 0
    @ 2026-7-29 0:17:11
    #include<bits/stdc++.h>
    using namespace std;
    int main(){
        int n;
        cin>>n;
        if(n/1000>=1){
            cout<<4;
        }else if(n/100>=1){
            cout<<3;
        }else if(n/10>=1){
            cout<<2;
        }else{
            cout<<1;
        }
        return 0;
    }
    
    • 1