我一直在这里绞尽脑汁:
cout << orig << " * " << count << endl;
string check = multiply2(orig, count);
cout << "Check was: " << check << " and number is: " << number << endl;
cout << "the compare result: " << check.compare(number) << endl;
if(check.compare(number) == 0)
{
cout << "wahoo it matches!!! we did it! " << endl;
}
else
{
cout << "Doesnt Match " << endl;
}
我希望它能够匹配并打印wahoo it matches!!! we did it!
,但它却说它不匹配。
这是我的输出:
1 * 900000
Check was: 900000 and number is: 90000
the compare result: 1
Doesnt Match
任何人都知道他们为什么不匹配?