Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <clocale>
- #include <string>
- #include <iostream>
- using namespace std;
- int main()
- {
- setlocale(LC_ALL, "Rus");
- string str;
- int n = 0;
- cout << "Введите слова: ";
- for (;;) {
- cin >> str;
- int end = str.find("done", 0);
- if (end != string::npos) break;
- else n++;
- }
- cout << endl << "До ключевого слова было " << n << " слов" << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement