回答編集履歴

1

リファクタリング

2016/12/09 09:10

投稿

carimatics
carimatics

スコア740

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& num : nums) {
45
+ for (int& n : nums) {
48
46
 
49
- cout << num << endl;
47
+ cout << n << endl;
50
48
 
51
49
  }
52
50