HDU 5752 Sqrt Bo【枚举，大水题】

0
0
0
1. 云栖社区>
2. 博客>
3. 正文

## HDU 5752 Sqrt Bo【枚举，大水题】

angel_kitty 2017-07-11 09:00:00 浏览402

# Sqrt Bo

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)
Total Submission(s): 2221    Accepted Submission(s): 882

Problem Description
Let's define the function

Input
This problem has multi test cases(no more than

Output
For each test case print a integer - the answer

Sample Input
233
233333333333333333333333333333333333333333333333333333333

Sample Output
3
TAT

Author

Source

 1 #include <bits/stdc++.h>
2 using namespace std;
3 typedef long double ll;
4 inline ll gcd(ll x)
5 {
6     int k,t;
7     int flag=0;
8     for(k=1;k<=5;k++)
9     {
10         x=(long long)sqrt(x);
11         if(x==1)
12         {
13             flag=1;
14             t=k;
15             break;
16         }
17     }
18     if(flag)
19         return t;
20     return 0;
21 }
22 int main()
23 {
24     ll n;
25     while(cin>>n)
26     {
27     if(!gcd(n))
28         cout<<"TAT"<<endl;
29     else cout<<gcd(n)<<endl;
30     }
31     return 0;
32 }

angel_kitty
+ 关注