SHOW:
|
|
- or go back to the newest paste.
1 | - | fstream input("text1.txt"); |
1 | + | #include <iostream> |
2 | - | string line; |
2 | + | #include <vector> |
3 | - | vector<string> lines; |
3 | + | #include <fstream> |
4 | - | while (getline(input, line)) |
4 | + | #include <string> |
5 | ||
6 | - | lines.push_back(line); |
6 | + | using namespace std; |
7 | void main() | |
8 | { | |
9 | - | vector<char>::iterator v = lines.begin(); |
9 | + | fstream input; |
10 | input.open("text.txt", ios::in | ios::out); | |
11 | - | while (*v = ' ') |
11 | + | string line; |
12 | - | { |
12 | + | vector<string> lines; |
13 | - | lines.pop_back(*v); |
13 | + | while (getline(input, line)) |
14 | - | } |
14 | + | |
15 | lines.push_back(line); | |
16 | } | |
17 | vector<int>vec; | |
18 | vector<string>::iterator v = lines.begin(); | |
19 | ||
20 | while (v != lines.end()) | |
21 | { | |
22 | cout << *v << endl; | |
23 | v++; | |
24 | } | |
25 | } |