1 solutions

  • 0
    @ 2024-12-5 18:10:16

    C++ :

    #include<bits/stdc++.h>
    using namespace std;
    int q,a,z,w,s,x,e,d,c,r,f,v,t,g,b,y,h,n,u,j,m,i,k,o,l,p;
    int main(){
    cin>>n;
    while(n!=0){
    s=n%10;
    n=n/10;
    if(s==1){
    c++;
    }
    }
    cout<<c;
    return 0;
    }
    
    
    • 1

    Information

    ID
    9118
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By