1. If want to reuse the same stringstream object, need to clear the buffer before use.
stream.clear() works in Dev-C++.
Others recommended stream.str(""), but it doesn't work in my code.
2. int: 10, 100, 1000, 10000...
After being converted to string type and reversed, they'll be 01, 001, 0001, 00001... Convert them back to int, will get just 1, no more zeros.
3. reverse int : 1000000003 can cause overflow problem.
So use long long type to save 3000000001. Problem solved.
4. Assignme......
阅读全文