3 solutions

  • 2
    @ 2024-11-5 19:50:24
    #include<bits/stdc++.h> 
    using namespace std; 
    char s[255]; 
    int main() 
    { 
    	int cnt=0; 
    	cin.getline(s,255); 
    	for(int i=0;i<strlen(s);i++)
    	{ 
    		if(s[i]<='9' and s[i]>='0')
    		{ 
    			cnt++; 
    		} 
    	}
    	cout<<cnt;
    	return 0; 
    }
    

    这是题解,懂?🤨 [🥬🐔]

  • 1
    @ 2026-2-3 16:20:18
    #include<bits/stdc++.h>
    using namespace std;
    char a[313];
    int main()
    {
    	cin.getline(a,313);
    	int cnt=0;
    	for (int i=0;i<313;i++)
    	{
    		if(a[i]>='0' and a[i]<='9')
    		{
    			cnt+=1;
    		}
    	}
    	cout<<cnt;
    	return 0;
    }	
    
    • -8
      @ 2024-6-22 20:00:55

      #include<bits/stdc++.h> using namespace std; char a[255]; int main() { int d=0; cin.getline(a,255); for(int i=0;i<strlen(a);i++){ if(a[i]<='9' and a[i]>='0'){ d++; } }

      cout<<d; return 0; }

      • 1

      Information

      ID
      913
      Time
      1000ms
      Memory
      256MiB
      Difficulty
      1
      Tags
      (None)
      # Submissions
      139
      Accepted
      18
      Uploaded By