为什么超时?萌新求解
查看原帖
为什么超时?萌新求解
360695
xiaotao_Jwhite楼主2020/7/19 08:56
#include<iostream>
using namespace std;
int main(){
	int n,x,i,s;
	cin>>n>>x;
	for(i=1;i<=n;i++){
		while(i>0){
			if(i%10==x){
				s++;
				i=i/10;
			}
		}
	}
	cout<<s;
	return 0;
} 
2020/7/19 08:56
加载中...