题目链接: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("= "); 17 } 18 else 19 { 20 if(xx-0 < eps) 21 { 22 printf("< "); 23 } 24 else 25 { 26 printf("> "); 27 } 28 } 29 30 return 0; 31 }