#include using namespace std; std::vector split(std::string str, char del) { int first = 0; int last = str.find_first_of(del); std::vector result; while (first < str.size()) { std::string subStr(str, first, last - first); result.push_back(subStr); first = last + 1; last = str.find_first_of(del, first); if (last == std::string::npos) { last = str.size(); } } return result; } int main() { std::string str; char del = ','; bool flag = true; cin >> str; for (const auto subStr : split(str, del)) { if(!subStr.compare("AC")){ flag = false; } } if(flag){ printf("Done!"); } else { printf("Failed..."); } return 0; }