Title: Portal.
Test instructions: A large number of N, up to 5 times the root of the root, ask several square root can get 1, if 5 times can not get 1 on the output tat.
Problem solving:x1=1,x2= (x1+1) * (x1+1)-1, etc. X5 is not more than a long long , the output can be judged.
#include <iostream>#include<cstdio>#include<cstring>#include<cmath>using namespaceStd;typedefLong Longll;Charc[1005];intMain () { while(cin>>c) {intlen=strlen (c); if(len>= the) {printf ("tat\n"); } Else{ll n=c[0]-'0'; LL Maxx=4294967295; for(intI=1; i<len;i++) n=n*Ten+c[i]-'0'; if(n==0) printf ("tat\n"); Else if(n==1) printf ("0\n"); Else if(n<=3) printf ("1\n"); Else if(n<= the) printf ("2\n"); Else if(n<=255) printf ("3\n"); Else if(n<=65535) printf ("4\n"); Else if(n<=Maxx) printf ("5\n"); Elseprintf ("tat\n"); } } return 0;}
HDU 5752 Sqrt Bo (thinking problem) 2016 Hangzhou Electric Multi-school joint third Field