Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <string>
- #include <windows.h>//для system("pause")
- using namespace std;
- int main()
- {
- int k1, k2;
- cin >> k1 >> k2;
- k1--;// строки в 0 индексации
- k2--;
- ifstream in("input.txt");
- while (in.peek() != EOF)
- {
- string current;
- getline(in, current);
- for (int i = k1; i <= k2; ++i)
- cout << current[i];
- cout << endl;
- }
- in.close();
- system("pause");
- }
- /*
- Замечание: файл "input.txt" нужно создать
- пример:
- consoleInput: 2 5
- file "input.txt":
- abacaba
- cadaba
- KrivobokTOP
- NoVteniseTakSebe
- consoleOutput:
- baca
- adab
- rivo
- oVte
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement