Codeforces 616A comparing Long integers

Source: Internet
Author: User

A. Comparing A Long integers

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

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

As Input/output can reach huge size it is recommended-use fast input/output methods:for example, prefer-to-use SCA  Nf/printfinstead of Cin/cout in C + +, prefer to use bufferedreader/printwriter instead of scanner/system.out in Java. Don ' t use the function , input () in Python2 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 the them contains no more than6 digits.

Output

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

Sample Test (s) input
9
10
Output
<
Input
11
10
Output
>
Input
00012345
12345
Output
=
Input
0123
9
Output
>
Input
0123
111
Output
>
#include <cstdio>#include<cstring>#include<stack>#include<iterator>#include<vector>#include<iostream>#include<map>#include<string>#include<algorithm>using namespaceStd;typedefLong Longll;typedef unsignedLong Longull;Const intmaxn=1e6+5;intMain () {intlen[2]; Chars[2][MAXN];  for(intI=0;i<2; i++) scanf ("%s", S[i]), len[i]=strlen (S[i]); inti,j;  for(i=0; i<len[0];i++)        if(s[0][i]!='0') Break;  for(j=0; j<len[1];j++)        if(s[1][j]!='0') Break; if(len[0]-i>len[1]-j) puts (">"); Else if(len[0]-i<len[1]-j) puts ("<"); Else    {         for(; i<len[0];i++,j++)            if(s[0][i]!=s[1][J]) Break; I==len[0]?puts ("="):p UTS (s[0][i]>s[1][J]?">":"<"); }    return 0;}

Codeforces 616A comparing Long integers

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.