//将输入中的标点转换为空白符。
#include"../实践/std_lib_facilities.h"
int main()
try
{
//将输入读入字符串向量中。
vector<string>lines;
string line;
while (cin >> line)lines.push_back(line);
//---------------------------------------------------------------
//识别字符串向量中每一个元素,如果只是标点,就将其做空;如果是要求字符串,则进行转换。
for (int i = 0; i < lines.size(); i++)
{
if (lines[i] == "don't") lines[i] = "do not";
else if (lines[i] == "can't") lines[i] = "can not";
if(ispunct(lines[i][0]))lines[i]=' ';//默认按正确格式输入。
else if (ispunct(lines[i][lines[i].size() - 1]))lines[i] = lines[i].erase(lines[i].size() - 1, 1);
}
//---------------------------------------------------------------
//输入字符串向量,如果其中的元素是空格,则跳过其输出。
for (int i = 0; i < lines.size(); i++)
if (lines[i] != " ") { cout << lines[i] << ' '; }
}
catch (exception& e) {
cerr << "error: " << e.what() << '\n';
return 1;
}
catch (...) {
cerr << "Oops: unknown exception!\n";
return 2;
};
//--------------------------------------------------------------------