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已AC:#include <iostream> #include <string> void Erase(std::string & s); int main() { using namespace std; string a, b; while(cin >> a >> b) //易考虑不周全 { int k = 0; Erase(a); Erase(b); if(a==b) cout << "YES"; else cout << "NO"; cout << endl; } return 0; } void Erase(std::string & s) { if(s.find('.')!=std::string::npos) //查找单字符成员函数!! { int k = s.size()-1; while(s[k]=='0') { k--; s.erase(k+1, 1); //活用string类! } if(s[k]=='.') { k--; s.erase(k+1, 1); } } }