求证
查看原帖
求证
1073342
Genshin_ZFYX楼主2024/7/7 09:26

我赛时没写出来QwQ

我写出来了,但我不知道证明方法,请各位大佬教导!

#include<bits/stdc++.h>
using namespace std;
signed main()
{
    cin.tie(0)->sync_with_stdio(0);
    int t;cin>>t;
    while(t--)
    {
    	int n;cin>>n;
	    for(int i=2;i<=n;i++)
	    if(n%i!=0)
	    {
	        cout<<i<<endl;
	        break;
	    }
	}
	return 0;
}

2024/7/7 09:26
加载中...