Description
Input
Output
Sample Input
Sample Output
Hint
Description
Input
Output
Sample Input
1 2
2 2
3 3
4 3
Sample Output
NO YES YESNO
测试数据:
0 -0
0 +0
123.123 +00123.12300
100.00 100
.1 0.1
000.000 0
123456789123456789 123456789123456789
1 1
000001000. 1000
#include <iostream> #include <stdio.h> #include <string.h> using namespace std; char a[100000],b[100000]; void change(char s[]) { int i,len; len=strlen(s); if(strstr(s,".")) { for(i=len-1; s[i]=='0'; i--) { s[i]='\0'; len--; } } if(s[len-1]=='.') { s[len-1]='\0'; } } int main() { while(cin>>a>>b) { change(a); change(b); if(strcmp(a,b)) { cout<<"NO"<<endl; } else { cout<<"YES"<<endl; } } return 0; }