2 solutions

  • 3
    @ 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; 
    }
    

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

    • -6
      @ 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
      94
      Accepted
      37
      Uploaded By