求助大佬
查看原帖
求助大佬
419775
xurunsong楼主2020/12/14 17:09
#include<iostream>
using namespace std;
int main()
{
    long long a,m,n,w,g;
    bool s=1;
    cin>>g;
    for(int i=1;i<=g;++i)
    {
    	cin>>m>>n;
    	a=m;
    	for(w=m;a<=n;w++)
    	{
    		for(int q=2;q<a;q++)
    		{
    			if(a%q==0)
    			{
    				s=0;
				}
    		}
    		if(s)
    		cout<<a<<endl;
    		a++;
    		s=1;
		}
	}
}

怎么TLE了,自己测试时没有问题啊

2020/12/14 17:09
加载中...