题意:求一个数经过5次开方取整后能否变为1
题意:很容易求出当n>2^32次后肯定不行
所以当n<2^32时,直接模拟就好
#include<bits/stdc++.h>
using namespace std;
int main()
{
char s[1111];
while(scanf("%s",&s)!=EOF) {
if(strlen(s)>10) {
printf("TAT\n");
continue;
}
long long tot=0;
for(int i=0;i<strlen(s);i++) {
tot=tot*10+s[i]-'0';
}
int tt=0;
if(tot==0) {
printf("TAT\n");
continue;
}
while(tot>1) {
tot=sqrt(tot);
tt++;
}
if(tt>5) {
printf("TAT\n");
}
else {
printf("%d\n",tt);
}
}
return 0;
}