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.
On the only line of input there are two integers xx and yy (1≤x,y≤1091≤x,y≤109).
If xy<yxxy<yx, then print '<' (without quotes). If xy>yxxy>yx, then print '>' (without quotes). If xy=yxxy=yx, then print '=' (without quotes).
5 8
>
10 3
<
6 6
=
In the first example 58=5⋅5⋅5⋅5⋅5⋅5⋅5⋅5=39062558=5⋅5⋅5⋅5⋅5⋅5⋅5⋅5=390625, and 85=8⋅8⋅8⋅8⋅8=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
题解:特判有1的情况,有2的情况,2特判另一个数是3或者4,还有一个就是相等的,其他的情况,x>y,输出<,否则输出>
.
#include<bits/stdc++.h>
using namespace std;
int x, y;
int main(){
// cout<<pow(5, 6)<<" "<<pow(6, 5)<<endl;
cin>>x>>y;
if(x == y) {
cout<<"="<<endl;
return 0;
}
if(x == 1){
cout<<"<"<<endl;
return 0;
}
else if(y == 1){
cout<<">"<<endl;
return 0;
}
if(x == 2){
if(y == 3){
cout<<"<"<<endl;
return 0;
}
else if(y == 4){
cout<<"="<<endl;
return 0;
}
else{
cout<<">"<<endl;
return 0;
}
}
if(y == 2){
if(x == 3){
cout<<">"<<endl;
return 0;
}
else if(x == 4){
cout<<"="<<endl;
return 0;
}
else{
cout<<"<"<<endl;
return 0;
}
}
if(x > y){
cout<<"<"<<endl;
}
else {
cout<<">"<<endl;
}
}