求调
查看原帖
求调
1422623
lsyssst楼主2025/8/31 18:20
#include <bits/stdc++.h>
using namespace std;

int main() 
{
	int n;
    cin>>n;
    for(int i=1;i<=n;i++) 
	{
        int x;
        cin>>x;
        int cnt=0;
        for(int j=2;j*j<=x;j++) 
		{
            if(x%j==0)
			{
                cnt++;
            } 
            while(x%j==0) 
			{
                x/=j;
            }
        }
        if(x>1) 
		{
            cnt++;
        }
        if(cnt==2)
		{
            cout<<1<<endl;
        } 
		else 
		{
            cout<<0<<endl;
        }
    }
    return 0;
}

过后定加关注!!

2025/8/31 18:20
加载中...