hdu2054 A==B
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
include<iostream> #include<cstdio> #include<string> using namespace std; int main() { string a,b; while(cin>>a>>b) { if(a[0]=='+'&&a[1]=='0'&&a.size()==2)a="0"; if(a[0]=='-'&&a[1]=='0'&&a.size()==2)a="0"; if(b[0]=='+'&&b[1]=='0'&&b.size()==2)b="0"; if(b[0]=='-'&&b[1]=='0'&&b.size()==2)b="0"; if(a==b&&b=="0")continue; if(a[0]=='+') { a.erase(0,1); } while(a[0]=='0'&&a[1]!='.'&&a.size()!=1) { a.erase(0,1); } while(a[0]=='-'&&a[1]=='0'&&a[2]!='.') { a.erase(1,1); } while((a.find('.')!=string::npos)&&a[a.size()-1]=='0') { a.erase(a.size()-1,1); } if(a[a.size()-1]=='.')a.erase(a.size()-1,1); if(b[0]=='+') { b.erase(0,1); } while(b[0]=='0'&&b[1]!='.'&&a.size()!=1) { b.erase(0,1); } while(b[0]=='-'&&b[1]=='0'&&b[2]!='.') { b.erase(1,1); } while((b.find('.')!=string::npos)&&b[b.size()-1]=='0') { b.erase(b.size()-1,1); } if(b[b.size()-1]=='.')b.erase(b.size()-1,1); //cout<<a<<" "<<b<<endl; if(a==b)cout<<"YES"<<endl; else cout<<"NO"<<endl; } }