回答編集履歴
1
修正
test
CHANGED
@@ -60,15 +60,9 @@
|
|
60
60
|
|
61
61
|
|
62
62
|
|
63
|
-
flag1, flag2, flag3, flag4 = 0, 0, 0, 0
|
64
|
-
|
65
|
-
|
66
|
-
|
67
63
|
if coin_500 > 0
|
68
64
|
|
69
65
|
num_500 = res / 500
|
70
|
-
|
71
|
-
flag1 = 1 if num_500 == 0
|
72
66
|
|
73
67
|
puts "500円:#{num_500}枚"
|
74
68
|
|
@@ -82,8 +76,6 @@
|
|
82
76
|
|
83
77
|
num_100 = res / 100
|
84
78
|
|
85
|
-
flag2 = 1 if num_100 == 0
|
86
|
-
|
87
79
|
puts "100円:#{num_100}枚"
|
88
80
|
|
89
81
|
res = res - (100 * num_100)
|
@@ -95,8 +87,6 @@
|
|
95
87
|
if coin_50 > 0
|
96
88
|
|
97
89
|
num_50 = res / 50
|
98
|
-
|
99
|
-
flag3 = 1 if num_50 == 0
|
100
90
|
|
101
91
|
puts "50円:#{num_50}枚"
|
102
92
|
|
@@ -110,8 +100,6 @@
|
|
110
100
|
|
111
101
|
num_10 = res / 10
|
112
102
|
|
113
|
-
flag4 = 1 if num_10 == 0
|
114
|
-
|
115
103
|
puts "10円:#{num_10}枚"
|
116
104
|
|
117
105
|
res = res - (10 * num_10 )
|
@@ -120,7 +108,7 @@
|
|
120
108
|
|
121
109
|
end
|
122
110
|
|
123
|
-
if
|
111
|
+
if coin_500 + coin_100 + coin_50+ coin_10 == 0
|
124
112
|
|
125
113
|
break
|
126
114
|
|