You are viewing a single comment's thread. Return to all comments →
A slight variant:
string S; cin >> S; string sos = "SOS"; int sum = 0; for (int i = 0; i < S.length(); i++) { if (S[i] - sos[i % 3]) { sum++; } } cout << sum << endl;
Seems like cookies are disabled on this browser, please enable them to open this website
Mars Exploration
You are viewing a single comment's thread. Return to all comments →
A slight variant: