#include <iostream>
#include <string>
#include <cctype>
int main()
{
std::string str, result_str;
bool flag=false;
while(getline(std::cin, str))
{
for(unsigned index=0; index<str.size(); ++index)
{
char ch;
ch = str[index];
if(ispunct(ch))
flag = true;
else
result_str += ch;
}
if(flag)
std::cout << result_str << std::endl;
else
std::cout << "no flag" << std::endl;
}
return 0;
}
原文地址:http://blog.csdn.net/xumesang/article/details/45532383