HDU 2054 A==B?

来源:互联网 发布:环境监测数据造假案例 编辑:程序博客网 时间:2024/05/16 11:21

A == B ?

Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 80693    Accepted Submission(s): 12754


Problem Description
Give you two numbers A and B, if A is equal to B, you should print "YES", or print "NO".
 

Input
each test case contains two numbers A and B.
 

Output
for each case, if A is equal to B, you should print "YES", or print "NO".
 

Sample Input
1 22 23 34 3
 

Sample Output
NOYESYESNO
 

Author
8600 && xhd
 

Source
校庆杯Warm Up
 


注意区分 0010. 10            001.00000   1                         1 1.        等这类情况

#include <stdio.h>#include <stdlib.h>#include <string.h>char s1[50000],s2[50000];void fun(char a[]){char *s = a;    while(*s == '0')s++;strcpy(a,s);    if(strchr(a,'.')){int len = strlen(a);char *p = a+len-1;while(*p == '0')*(p--) = 0;if(*p == '.')  *p = 0;}}int main(){int n;while(~scanf("%s%s",s1,s2)){fun(s1);fun(s2);if(strcmp(s1,s2)==0)printf("YES\n");elseprintf("NO\n");}}


0 0