一级阅读程序-2

1  #include <bits/stdc++.h>
2  using namespace std;
3  int main(){
4     int n;
5     cin>>n;
6     for(int i=1;i<=n;i++)
7     {
8       long long a;
9       cin>>a;
10      bool f=true;
11      for(int j=1;j*j*j*j<=a;j++)
12      {
13        if(j*j*j*j==a)
14        {
15          cout<<j<<' ' ;
16          f=false;
17          break;
18        }
19      }
20     if(f==true)
21    cout<<"-1"<<' ';
22    }
23    return 0;
24 }
Scroll to Top