```cpp
内循环变量名都写成外循环的变量名了,此错误一定检查不要再发生
第一次写的超时了,遇到约数,质数这种运用开根sqrt来优化
include[HTML_REMOVED]
include[HTML_REMOVED]
include[HTML_REMOVED]//可有可无
using namespace std;
int main(){
int n,x,i,j;
long long sum;
cin>>n;
for(i=1;i<=n;i)
{
sum=0;
cin>>x;
for(j=1;j<=sqrt(x);j)//要取到根下x
{
if(x%j==0)
{
sum+=j+x/j;
}
if(j*j==x)//此时两个约数相同,重复了
{
sum-=j;
}
}
if(sum==x*2)
{
cout<<x<<" is perfect"<<endl;
}
else
cout<<x<<" is not perfect"<<endl;
}
return 0;
}