1 solutions

  • 0
    @ 2024-12-5 18:22:54

    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>>x;
    for(i=1;i<=n;i++){
    int q=i;
    while(q!=0){
    s=q%10;
    q=q/10;
    if(s==x){
    c++;
    }
    }
    }
    cout<<c;
    return 0;
    }
    
    
    • 1

    Information

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