#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; }
时间: 2024-10-01 02:47:28