Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <fstream>
- #include <string>
- #include <Windows.h>
- using namespace std;
- int main()
- {
- setlocale(LC_ALL, "Russian");
- SetConsoleCP(1251);
- SetConsoleOutputCP(1251);
- ifstream in("input.txt");
- ofstream out("output.txt");
- string s, k;
- int c = 0;
- while (getline(in, s)) {
- for (int i = 0; i < s.length(); i++) {
- if (not(s[i] >= ' ' && s[i] <= '&') && not (s[i] >= '(' && s[i] <= '/')) {
- c++;
- }
- else {
- if (c == 1) {
- int h = i - 1;
- s.erase(h, 1);
- c = 0;
- i -= 1;
- }
- else c = 0;
- }
- }
- out << s << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement