did not see test instructions, led to WA two times, when the same time, to output a==b, I am also drunk
Time limit over size: theMs | Memory Limit:65535KB Difficulty:2
-
-
Describe
-
Give you two big numbers, can you tell the size of their two numbers?
For example, 123456789123456789 to greater than-123456
-
-
Input
-
-
one row for each set of test data, enter two 1000-bit 10 binary integers, a, b
The data guarantees that the input a, B, has no prefix of 0.
If input 0 0 indicates the end of the input. No more than 10 groups of test data groups
-
-
Output
-
If
-
a>b outputs "a>b", if a<b outputs "a<b", then output "a==b" if equal.
-
-
Sample input
-
-
111111111111111111111111111 88888888888888888888-1111111111111111111111111 222222220 0
-
-
Sample output
-
-
A>ba<b
-
-
Uploaded by
-
-
Zhang Yunzun
#include <stdio.h> #include <string.h> #define MAXN 2000char a[maxn],b[maxn];int main () {int len1,len2;while (scanf ("%s%s", b)!=eof) {Len1=strlen (a); Len2=strlen (b); if (a[0]== ' 0 ' &&b[0]== ' 0 ') break;if (a[0]== '-' &&b[0]!= '-') printf ("a<b\n"), else if (a[0]!= '-' &&b[0]== '-') printf ("a>b\n"), else if (a[0]!= '-' &&b[0]!= '-') {if (len1>len2) printf ("a>b\n"), else if (len1<len2) printf ("a<b\n"); else if (len1==len2) {if (strcmp (A, B) >0) printf ("a>b\n"), Else if (strcmp (A, b) ==0) printf ("a==b\n"), Else if (strcmp (b) <0) printf ("a<b\n");}} else if (a[0]== '-' &&b[0]== '-') {if (len1>len2) printf ("a<b\n"); else if (len1<len2) printf ("a>b\n") ; else if (len1==len2) {if (strcmp (b) >0) printf ("a<b\n"), Else if (strcmp (A, b) ==0) printf ("a==b\n"); else if ( strcmp (A, b) <0) printf ("a>b\n");}} return 0;}
Nyoj 73 than Size "string comparison"