牛客练习-数字比较

牛牛很喜欢对数字进行比较,但是对于3 > 2这种非常睿智的比较不感兴趣。上了高中之后,学习了数字的幂,他十分喜欢这种数字表示方法,比如xy。

由此,他想出了一种十分奇妙的数字比较方法,给出两个数字x和y,请你比较xy和yx的大小,如果前者大于后者,输出">",小于则输出"<",等于则输出"="。

输入描述:

 

两个数字x和y。

满足1 <= x,y <= 109


 

输出描述:

一个字符,">","<"或者"="。

示例1

输入

2 2

输出

=

示例2

输入

2 4

输出

=
#include<iostream>
using namespace std;
int main()
{
    int x,y;
    cin>>x>>y;
    if(x==y)cout<<'='<<endl;
    else if(x==1&&y>1)cout<<'<'<<endl;
    else if(y==1&&x>1)cout<<'>'<<endl;
    else if(x==2&&y==3)cout<<'<'<<endl;
    else if(x==2&&y==4)cout<<'='<<endl;
    else if(x==2&&y==5)cout<<'>'<<endl;
    else if(y==2&&x==3)cout<<'>'<<endl;
    else if(y==2&&x==4)cout<<'='<<endl;
    else if(y==2&&x==5)cout<<'<'<<endl;
    else
    {
        if(x>y)cout<<'<'<<endl;
        else cout<<'>'<<endl;
    }
    return 0;
}

猜你喜欢

转载自blog.csdn.net/wys5wys/article/details/84440070