HDU-5170

/*众所周知,GTY是一位神犇,为了更好的虐场,他从来不写数学作业而是去屠题,他的数学老师非常不爽,但由于GTY每次考试都AK,她也不能说什么,
有一天老师在黑板上写了四个数——a,b,c,d 然后让GTY比较a^b和c^d的大小,由于GTY不屑于虐这道题,就把这个问题交给你了。
输入描述
多组数据(约5000组),每组数据包含4个整数a,b,c,d(1≤a,b,c,d≤1000),用空格隔开
输出描述
对于每组数据,若a^b>c^d,输出”>”, 若a^b<c^d,输出”<”, 若a^b=c^d,输出”=”
输入样例
2 1 1 2
2 4 4 2
10 10 9 11
输出样例
>
=
<
原型:doublelog(double x);

  头文件:math.h

  功能:计算以e 为底的对数值

  程序例:{ double result;

  double x = 321.123;

  result = log(x);

  printf(The common log of %lf is %lf , x, result);

  return 0}*/

#include<stdio.h>
#include<math.h>
int main()
{
    double m,n,a,b,c,d;
    while(scanf("%lf%lf%lf%lf",&a,&b,&c,&d)!=EOF)
    {
        m=b*log(a);
        n=d*log(c);
        if(fabs(m-n)<=1e-9)printf("=
");
        else if(m-n<1e-9)printf("<
");
        else printf(">
");
    }
    return 0;
}
原文地址:https://www.cnblogs.com/tt-t/p/5022566.html