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 2
2 2
3 3
4 3
Sample Output
NO
YES
YES
NO
#include<iostream>
#include<string.h>
using namespace std;
void xl(char *a,int l){
int len = l-1;
while(a[len]=='0'){
len--;
}
if(a[len]=='.'){
len--;
}
a[len+1]='\0';
}
int main()
{
int l1=0,l2=0,sd1,sd2,s1,s2,e1,e2;
char a[100000],d[100000];
while(cin>>a){
cin>>d;
l1 = strlen(a);
l2 = strlen(d);
int i,j;
for(i=0;i<l1;i++){
if(a[i]=='.'){
xl(a,l1);
break;
}
}
for(j=0;j<l2;j++){
if(d[j]=='.'){
xl(d,l2);
break;
}
}
if(strcmp(a,d)){
cout<<"NO"<<endl;
}else{
cout<<"YES"<<endl;
}
}
return 0;
}