A = = B? (Hangzhou electric 2054)

Source: Internet
Author: User

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)

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.