Problem A: Do not come out to kick the association!!! time limit: 1 Sec memory limit: MB
Submitted by: 291 Resolution: 33
Submitted State [Discussion Version] Title Description
This is today the most water of a problem, if not written out, hehe, play association.
Give you two integers a and b. Output a larger number, if the two-digit equal output can be any one. This water ...
Input
Input has multiple sets of test data. Each group of data has a and b two integers.
Tip: Data assurance does not have a leading 0.
Output
Outputs the final result.
Sample input
0 0
Sample output
0
Test instructions: Obviously a large number problem
Note: Consider the case of negative numbers
#include <stdio.h> #include <string.h>char a[1100000],b[1100000];int n,m;int len1,len2;int main () {int i,j, Ok;while (scanf ("%s%s", A, b)!=eof) {Len1=strlen (a); Len2=strlen (b); if (a[0]== '-' &&b[0]!= '-') {printf ("%s\n", b); continue;} else if (a[0]!= '-' &&b[0]== '-') {printf ("%s\n", a); continue;} else if (a[0]== '-' &&b[0]== '-') {if (len1>len2) printf ("%s", b), else if (len1<len2) printf ("%s", a); Else{ok =1;for (i=0;i<len1;i++) {if (A[i]==b[i]) Continue;else if (A[i]>b[i]) {ok=0;printf ("%s", b); break;} else if (A[i]<b[i]) {ok=0;printf ("%s", a); break;}} if (OK) printf ("%s", a);} printf ("\ n");} Else{if (LEN1>LEN2) printf ("%s", a), else if (len1<len2) printf ("%s", b), Else{ok=1;for (i=0;i<len1;i++) {if (a[i ]==b[i]) Continue;else if (A[i]>b[i]) {ok=0;printf ("%s", a); break;} else if (A[i]<b[i]) {ok=0;printf ("%s", b); break;}} if (OK) printf ("%s", a);} printf ("\ n");} } return 0;}
Hpuoj problem A: Do not come out Kicking association!!!