3 条题解

  • 6
    @ 2023-2-20 20:36:24
    #include <bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int a;
    	cin>>a;
    	if (a < 10)
            cout << "1";
    	else if (a < 100)
            cout << "2";
    	else if (a < 1000)
            cout << "3";
    	else
            cout << "4";
    	return 0;
    }
    
    • 1
      @ 2023-4-9 19:07:30

      直接用string类型

      #include<bits/stdc++.h>
      using namespace std;
      int main()
      {
          string s;
          cin>>s;
          cout<<s.length();
          return 0;
      }
      • 0
        @ 2023-9-25 20:59:37
        #include<bits/stdc++.h>
        using namespace std;
        int main()
        {
            int c;
            cin >> c;
            if (c < 100)
            {
                cout << "1";
            }
            else if (c < 100)
            {
                cout << "2";
            }
            else if(c < 1000)
            {
                cout << "3";
            }
            else
            {
                cout <<"4";
            }
            return 0;
        }//A
        
        • 1

        信息

        ID
        707
        时间
        1000ms
        内存
        16MiB
        难度
        1
        标签
        递交数
        94
        已通过
        74
        上传者