Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main()
- {
- string s;
- cout << "Введите текст" << endl;
- getline(cin, s);
- s.insert(s.end(), ' ');
- int k = -1, i = 0, j = 0, sum = 0;
- do
- {
- k = s.find(" ", k + 1);
- if (k != -1)
- {
- j = k - i;
- if (j == 5) {
- sum += 1;
- for (i; i < k; i++)
- cout << s[i];
- cout << " ";
- }
- }
- = k + 1;
- } while (k != -1);
- if (sum == 0)
- cout << "таких нет" << endl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement