sbtototototo

刘宇帆  •  1个月前


#include<bits/stdc++.h> 
using namespace std; 
int n,sum,m,x; 
int main() {  
cin>>n>>m; 
for(int i=1;i<=n ;i++){ 
    x=i; 
    while(x>0){ 
        if(x%10==m){ 
            sum++; 
        } 
        x/=10; 
    } 

cout<<sum; 
return 0; 


评论: