Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- int main()
- {
- std::string str = "";
- std::getline(std::cin, str);
- for (int i = 0; i < str.length(); i++)
- {
- std::cout << str[i];
- int cnt = 0;
- while (str[i] == '.' && str[i + 1] == '.')
- {
- cnt++;
- if (cnt > 2)
- i++;
- else if (str[i] == '.')
- std::cout << str[i];
- }
- }
- std::cout << std::endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement