hdu 5170 GTY's math problem(水,,数学,,)

题意:

给a,b,c,d。

比较a^b和c^d的大小

思路:

比较log(a^b)和log(c^d)的大小

代码:

int a,b,c,d;

int main(){

    while(scanf("%d%d%d%d",&a,&b,&c,&d)!=EOF){
        double x1 = b*log((double)a);
        double x2 = d*log((double)c);
        if(fabs(x1-x2)<eps){
            puts("=");
        }else{
            if(x1>x2){
                puts(">");
            }else{
                puts("<");
            }
        }
    }

    return 0;
}
原文地址:https://www.cnblogs.com/fish7/p/4311994.html