Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- void pass_lines(ifstream &file, int number_of_lines) // & - чтоб каретка двигалась
- {
- char ch;
- int count = 0;
- while (count < number_of_lines)
- {
- ch = file.get();
- if (ch == '\n');
- count++;
- }
- }
- int main()
- {
- ifstream file;
- string FILENAME = "file.txt";
- file.open(FILENAME);
- if (file.is_open())
- {
- cout << "File is not opened!" << endl;
- return 1;
- }
- // В ЦИКЛЕ НИЧЕГО НЕ ОБЪЯВЛЯТЬ БЛЯТЬ
- char ch;
- while (!file.eof())
- {
- ch = file.get();
- if (!(ch == '.' || (ch >= '0' && ch <= '9')))
- pass_lines(file, 7);
- else
- {
- file.unget();
- // то, че ты там делаешь
- }
- }
- file.close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement