A = = B?Time
limit:1000/1000 MS (java/others) Memory limit:32768/32768 K (java/others)
Total submission (s): 64239 Accepted Submission (s): 10060
Problem descriptiongive You both numbers A and B, if A is equal to B, you should print "YES", or print "NO".
Inputeach test Case contains-numbers A and B.
Outputfor each case, if A was equal to B, you should print "YES", or print "NO".
Sample Input
1 22 23) 34 3
Sample Output
Noyesyesno/* The first time to do is always to understand the topic too simple. After looking at the discussion area to consider a very wide range of circumstances, the hdoj of the problem only need to remove the decimal point meaningless 0 can be AC, without having to consider the integer part of meaningless 0. I don't know why. */#include <stdio.h> #include <string.h>char a[40000],b[40000];void pop (char *s) //Remove the decimal part of the string without meaning 0. {int I,len=strlen (s) -1;for (i=len;i>=0;i--) {if (s[i]== ' 0 ') len--;else break ;} if (s[i]== '. ') Suppose the number is like 9.00. The decimal point also needs to be removed. len--;s[len+1]= ' + ';} int main () {int i;while (scanf ("%s%s", A, b)!=eof) {for (I=0;i<strlen (a); i++) {if (a[i]== '. ') Pop (a);} For (I=0;i<strlen (b); i++) {if (b[i]== '. ') Pop (b);} if (strcmp (b)) printf ("no\n"); elseprintf ("yes\n");} return 0;}
Copyright notice: This article Bo Master original articles, blogs, without consent may not be reproduced.
A = = B? (Hangzhou electric 2054)