CodeForces 616A Comparing Two Long Integers

题意:给出两个带前导0的数字,比较大小

思路:直接模拟即可


#include<bits/stdc++.h>
using namespace std;

string a,b;
int main()
{
	cin >> a >> b;
	int len1 = a.size();
	int len2 = b.size();
	int la = 0,lb=0;
	while (a[la]=='0' && la<len1)
		la++;
	while (b[lb]=='0'&&lb<len2)
		lb++;
	if (len1-la>len2-lb)
		return puts(">");
	if (len1-la<len2-lb)
		return puts("<");
	for (int i = la;i<len1;i++)
	{
		if (a[i]>b[i-la+lb])
			return puts(">");
		else if (a[i]<b[i-la+lb])
			return puts("<");
	}
	return puts("=");
}


Description

You are given two very long integers a, b (leading zeroes are allowed). You should check what number a or b is greater or determine that they are equal.

The input size is very large so don't use the reading of symbols one by one. Instead of that use the reading of a whole line or token.

As input/output can reach huge size it is recommended to use fast input/output methods: for example, prefer to use scanf/printf instead ofcin/cout in C++, prefer to use BufferedReader/PrintWriter instead of Scanner/System.out in Java. Don't use the function input() inPython2 instead of it use the function raw_input().

Input

The first line contains a non-negative integer a.

The second line contains a non-negative integer b.

The numbers a, b may contain leading zeroes. Each of them contains no more than 106 digits.

Output

Print the symbol "<" if a < b and the symbol ">" if a > b. If the numbers are equal print the symbol "=".

Sample Input

Input
9
10
Output
<
Input
11
10
Output
>
Input
00012345
12345
Output
=
Input
0123
9
Output
>
Input
0123
111
Output
>


你可能感兴趣的:(CodeForces 616A Comparing Two Long Integers)