【题解】codeforces987BHigh School: Become Human 数学知识

在这里插入图片描述
取对数乘出来比较(同学的一道考试题……这题1分钟就没了吧)

#include<cstdio>
#include<iostream>
#include<cmath>
using namespace std;
const double eps=1e-6;
long double a,b,x,y;
int main()
{
	cin>>x>>y;
	a=y*log(x);b=x*log(y);
	if(fabs(a-b)<eps)cout<<"="<<endl;
	else if(a<b)cout<<"<"<<endl;
	else cout<<">"<<endl;
	return 0;
}

总结

猜你喜欢

转载自blog.csdn.net/qq_41958841/article/details/83479102