回答編集履歴
1
リファクタリング
test
CHANGED
@@ -18,10 +18,6 @@
|
|
18
18
|
|
19
19
|
int main() {
|
20
20
|
|
21
|
-
vector<int> nums;
|
22
|
-
|
23
|
-
|
24
|
-
|
25
21
|
ifstream fin("nums10.txt");
|
26
22
|
|
27
23
|
if (!fin) {
|
@@ -34,6 +30,8 @@
|
|
34
30
|
|
35
31
|
|
36
32
|
|
33
|
+
vector<int> nums;
|
34
|
+
|
37
35
|
int num;
|
38
36
|
|
39
37
|
while (fin >> num) {
|
@@ -44,9 +42,9 @@
|
|
44
42
|
|
45
43
|
|
46
44
|
|
47
|
-
for (int& n
|
45
|
+
for (int& n : nums) {
|
48
46
|
|
49
|
-
cout << n
|
47
|
+
cout << n << endl;
|
50
48
|
|
51
49
|
}
|
52
50
|
|