2 条题解

  • 1
    @ 2024-12-8 13:53:03

    #include<bits/stdc++.h>

    using namespace std;

    string s;

    int main()

    {

    int i,count=0;
    
    getline(cin,s);
    
    for(i=0;i<s.length();i++)
    
    if(s[i]>='0'&&s[i]<='9')
    
    count++;
    
    cout<<count<<endl;
    
    return 0;
    

    }

    • 0
      @ 2024-12-11 13:36:55
      #include<bits/stdc++.h>
      using namespace std;
      int main()
      { 
          int  num=0;
          string s;
          getline(cin,s);
          for(int i=0;i<s.length();i++)
          {
          	if(s[i]>='0'&&s[i]<='9')
          	{
          		num++;
      		}
      	}
      	cout<<num;
          
      }
      
      • 1

      信息

      ID
      158
      时间
      1000ms
      内存
      256MiB
      难度
      3
      标签
      递交数
      57
      已通过
      30
      上传者