eolymp
bolt
Try our new interface for solving problems
Problems

Count digits

published at 2/8/24, 6:14:12 pm

include <bits/stdc++.h>

define ll long long int

define ld long double

using namespace std; int main(){

ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
char n;
ll ans = 0;
while(cin>>n){
    if(n == '0' || n == '1' || n == '2' || n == '3' || n == '4' || n == '5' || n == '6' || n == '7' || n == '8' || n == '9'){
        ans++;
    }
}
cout<<ans;

} //TECHNOBLADE NEVER DIES