Pat 1091 N-自守数 (15 分)

#include
using namespace std;
bool judge(int t,int k){
    while( k ){
        int t1 = k % 10;
        int t2 = t % 10;
        if(t1 != t2)
            return false;
        k/=10;
        t/=10;
    }
    return true;
}
int main()
{
  int n;
  cin>>n;
  int flag = 1;
  while(n--){
    int t;
    cin>>t;
    for(int i=1; i<10; ++i)
    {
        if(judge(i*t*t,t))
        {
           cout<

你可能感兴趣的:(Pat 1091 N-自守数 (15 分))