#include <iostream>
using std::string;
using std::cout;
using std::cin;
using std::endl;
int main() {
string test("hello, this is a test string. ");
decltype(test.size()) size = 0;
while (size < test.size()) {
if (ispunct(test[size])) {
test.erase(size, 1);
}
size++;
}
cout << test << endl;
}
网友评论