[求助]哪位能详解一下这个程序
让您见笑了.
#include <iostream>
#include <algorithm>
using namespace std;
void main()
{
int a[9],n,s,i;
for(i=0;i<9;++i)
{
a[i]=i+1;
}
while(next_permutation(a,a+9))
{
n=10*(10*a[0]+a[1])+a[2];
s=0;
for(i=3;i<9;++i)
{
s =10*s+a[i]; }
if(n*n==s)
{
for(i=0;i<3;++i)
cout<<a[i];
cout<<"'s square is ";
for(i=3;i<9;++i)
cout<<a[i];
cout<<endl;
}
}
}