码迷,mamicode.com
首页 > 其他好文 > 详细

High School: Become Human(数学思维)

时间:2018-08-31 13:16:41      阅读:231      评论:0      收藏:0      [点我收藏+]

标签:pre   style   clu   tom   sch   main   cst   color   char   

Year 2118. Androids are in mass production for decades now, and they do all the work for humans. But androids have to go to school to be able to solve creative tasks. Just like humans before.

It turns out that high school struggles are not gone. If someone is not like others, he is bullied. Vasya-8800 is an economy-class android which is produced by a little-known company. His design is not perfect, his characteristics also could be better. So he is bullied by other androids.

One of the popular pranks on Vasya is to force him to compare xyxy with yxyx. Other androids can do it in milliseconds while Vasya‘s memory is too small to store such big numbers.

Please help Vasya! Write a fast program to compare xyxy with yxyx for Vasya, maybe then other androids will respect him.

Input

On the only line of input there are two integers xx and yy (1x,y1091≤x,y≤109).

Output

If xy<yxxy<yx, then print ‘<‘ (without quotes). If xy>yxxy>yx, then print ‘>‘ (without quotes). If xy=yxxy=yx, then print ‘=‘ (without quotes).

Examples
input
Copy
5 8
output
Copy
>
input
Copy
10 3
output
Copy
<
input
Copy
6 6
output
Copy
=
Note

In the first example 58=55555555=39062558=5⋅5⋅5⋅5⋅5⋅5⋅5⋅5=390625, and 85=88888=3276885=8⋅8⋅8⋅8⋅8=32768. So you should print ‘>‘.

In the second example 103=1000<310=59049103=1000<310=59049.

In the third example 66=46656=6666=46656=66. 

题目意思:给你两个数x, y, 比较 x^y 和 y ^ x 的大小

解题思路:

 

#include<cstdio>
#include<cmath>
int main()
{
    int x,y;
    scanf("%d%d",&x,&y);
    if(log(x)*y>log(y)*x)
    {
        printf(">\n");
    }
    else if(log(x)*y<log(y)*x)
    {
        printf("<\n");
    }
    else
    {
        printf("=\n");
    }
   return 0;
}

 

High School: Become Human(数学思维)

标签:pre   style   clu   tom   sch   main   cst   color   char   

原文地址:https://www.cnblogs.com/wkfvawl/p/9565221.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!