Advertisement
Pafnytiu

функция 3 - 17

Mar 20th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4. void func(std::string str,string::size_type k = 0, string::size_type pos = 0)
  5. {
  6. k = str.find(".", pos);
  7. if (k != string::npos)
  8. {
  9. str.insert (k+1,"...");
  10. pos = k+3;
  11. k = str.find (".",pos);
  12. cout << str << endl;
  13. }
  14. func(str, k, pos);
  15. }
  16. int main ()
  17. {
  18. setlocale(LC_ALL, "Russian");
  19. string::size_type k, pos;
  20. string str;
  21. getline(cin, str);
  22. func(str, k, pos);
  23. cout << str << endl;
  24. system("pause");
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement