【思维】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 }
文章搬运自我的个人博客http://duny31030.top
原博客为静态博客,因备份丢失无法继续更新,所以又搬运回博客园,可能部分文章阅读体验不好,可以到我的静态博客搜索相同标题查看

浙公网安备 33010602011771号