1 条题解

  • 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

    信息

    ID
    9188
    时间
    1000ms
    内存
    128MiB
    难度
    (无)
    标签
    递交数
    0
    已通过
    0
    上传者