70分,大数字不行(
查看原帖
70分,大数字不行(
1273558
Flax_shiep楼主2024/4/2 19:31
#include<cstdio>
#include<cmath>
using namespace std;
int main(){
    int n,x,c=0;
    scanf("%d%d",&n,&x);
    for(int i=1;i<n+1;i++){
        for(int j=0;j<6;j++){	
            if(int(i/pow(10,j))%10==x){
                c+=1;
            }
        }
    }
    printf("%d",c);
    return 0;
}
2024/4/2 19:31
加载中...