Geradot345

7.2

Dec 9th, 2020 (edited)
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. // Щеглов В.А. 19ВИ1
  2. #include <string>
  3. #include <iostream>
  4. using namespace std;
  5.  
  6. void name(string &s){
  7. string::size_type position = 0;
  8. while((position=s.find(92)) != string::npos){
  9. position=s.find(92);
  10. s.erase(1,position);
  11. }
  12. while((position=s.find('.')) != string::npos){
  13. position=s.find('.');
  14. s.erase(position);
  15. }
  16. }
  17.  
  18. int main()
  19. {
  20. setlocale(LC_ALL, "Russian");
  21. cout << "Enter string s: ";
  22. string s;
  23. getline(cin, s);
  24. s=' '+s;
  25. name(s);
  26. cout << "Completed string s: " << s << endl;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment