70分 求大佬 为什么超时
查看原帖
70分 求大佬 为什么超时
614091
2021xiaohu楼主2022/1/30 13:22
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	cin>>n;
	void fum(int n);
	fum(n);
	return 0;
 } 
 void fum(int n)
 {
 	int a[n],b[n];
 	for(int i=0;i<n;i++)
 	{
 	cin>>a[i];
 	b[i]=0;
    }
 	for(int p=0;p<n;p++)
 	{
 		for(int u=1;u<=a[p];u++)
 		{
 			for(int y=u;y!=0;y=y/10)
 			if(y%10==7)
 			{
 				b[p]++;
 				break;
			 }
		 }
	 }
	 for(int r=0;r<n;r++)
	 cout<<a[r]-b[r]<<endl;
  } 
2022/1/30 13:22
加载中...