标签:mat font iostream force display put end div pac
给你两个数x, y, 比较 x^y 和 y ^ x 的大小
Input
两个数 x, y, ( 1 <= x , y <= 109 )
Output
如果 x ^ y < y ^ x , 输出 “<”
如果 x ^ y > y ^ x , 输出 “>”
如果 x ^ y = y ^ x , 输出 “=”
Sample Input
5 8
>
10 3
<
6 6
=
x^y 和 y^x 比大小 不好比
可以转成求 y*logx 和 x*logy 的大小
#include <iostream> #include <cmath> using namespace std; int main() { int x,y; cin>>x>>y; if(y*log(x)<x*log(y)) cout<<"<"<<endl; else if(y*log(x)==x*log(y)) cout<<"="<<endl; else cout<<">"<<endl; return 0; }
标签:mat font iostream force display put end div pac
原文地址:https://www.cnblogs.com/coder-tcm/p/9314655.html