4 条题解

  • 3
    @ 2022-12-24 11:06:47
    #include <bits/stdc++.h>
    using namespace std;
    int main()
    {
        string s;
        cin >> s;
        int num = 0;
        for (int i = 0; i < s.length(); i++)
        {
            if (s[i] <= '9' && s[i] >= '0')
            {
                num++;
            }
        }
        cout << num;
        return 0;
    }
    
    • 1
      @ 2023-11-25 9:58:42
      #include <bits/stdc++.h> 
      using namespace std;
      int main()
      {
          string s;
          cin >> s;
          int num = 0;
          for(int i = 0; i < s.length(); i++)
          {
              if(s[i] >= '0' and s[i] <= '9')
              {
                  num++;
              }
          }
          cout << num;
          return 0;
      }
      
      • 1
        @ 2023-8-28 9:37:11
        #include<bits/stdc++.h>
        using namespace std;
        int ans;
        int main()
        {
            char c[10000005];
            scanf("%s",&c);
            int len=strlen(c);
            for(int i=0;i<len;i++)
                if(c[i]>='0'&&c[i]<='9')
                    ans++;
            printf("%d",ans);
            return 0;
        }
        
        • 0
          @ 2023-1-16 17:31:05

          极简代码:

          #include <bits/stdc++.h>
          char c;
          int s;
          int main()
          {
              while (std::cin >> c)
                  if (c >= '0' && c <= '9') s++;
              std::cout << s;
              return 0;
          }
          
          • 1

          信息

          ID
          1566
          时间
          1000ms
          内存
          256MiB
          难度
          2
          标签
          递交数
          89
          已通过
          52
          上传者