#include using namespace std; #include int main(){ string a; cin >> a; string b; int muri = 0; int count1 = 0; int copy1; int cou = count(a.begin(),a.end(),','); for(int i=1;i<=cou ;i++){ int fi = a.find(",",copy1); if(i==1)b = a.substr(0,fi); else b = a.substr(count1,fi); count1 += b.size()+1; cout << b << endl << fi << endl; if(b!="AC"){ muri++; break; } if(i==cou){ if(a.substr(count1)!="AC") muri++; } copy1 = fi; } if (muri==0)cout << "Done!"; else cout << "Failed..."; cout << muri; }