【题目描述】
输入两个整数,比较它们的大小。若x>yx>y,输出>>;若x=yx=y,输出==;若x<yx<y,输出<<。
【输入】
一行,包含两个整数xx和yy,中间用单个空格隔开。0≤x<2320≤x<232, −231≤y<231−231≤y<231。
【输出】
一个字符。若x>yx>y,输出 >> ;若x=yx=y,输出 == ;若x<yx<y,输出 << ;
【输入样例】
1000 100
【输出样例】
>
【来源】
#include <bits/stdc++.h>
using namespace std;
int pre(string s)
{
int an=0;
int flas=0;
if(s[0]=='-')
flas=1;
else an=s[0]-'0';
for(int i=1; i<(int)s.size(); i++)
{
an=an*10+s[i]-'0';
}
if(flas)
an=-an;
return an;
}
int main()
{
string s,c;
cin>>s>>c;
int m=pre(s);
int n=pre(c);
if(m>n)
cout<<">"<<endl;
else if(m==n)
cout<<"="<<endl;
else cout<<"<"<<endl;
return 0;
}