【思维】Codeforces Round #485 (Div. 2) B. High School: Become Human(对数)

题目链接:http://codeforces.com/contest/987/problem/B

 

 在运算的时候取对数就好了

 1 #include <bits/stdc++.h>
 2 
 3 using namespace std;
 4 
 5 #define ll long long
 6 #define eps 1e-6
 7 
 8 int main()
 9 {
10     ll x,y;
11     double xx;
12     scanf("%lld %lld",&x,&y);
13     xx = y*log10(x) - x*log10(y);
14     if(fabs(xx-0) <= eps)
15     {
16         printf("=\n");
17     }
18     else
19     {
20         if(xx-0 < eps)
21         {
22             printf("<\n");
23         }
24         else
25         {
26             printf(">\n");
27         }
28     }
29 
30     return 0;
31 }

猜你喜欢

转载自www.cnblogs.com/duny31030/p/9108981.html