回答編集履歴
1
else 削除
test
CHANGED
@@ -16,7 +16,7 @@
|
|
16
16
|
|
17
17
|
string s;
|
18
18
|
|
19
|
-
while (cin >> s)
|
19
|
+
while (cin >> s) {
|
20
20
|
|
21
21
|
if (s[0] == '-') {
|
22
22
|
|
@@ -26,19 +26,17 @@
|
|
26
26
|
|
27
27
|
}
|
28
28
|
|
29
|
-
|
29
|
+
bool c = true;
|
30
30
|
|
31
|
-
|
31
|
+
for (int i = s.size(); --i >= 0 && c; )
|
32
32
|
|
33
|
-
|
33
|
+
(s[i] < '9') ? (c = false, s[i]++) : (s[i] = '0');
|
34
34
|
|
35
|
-
|
35
|
+
if (c) cout << '1';
|
36
36
|
|
37
|
-
|
37
|
+
cout << s << ' ';
|
38
38
|
|
39
|
-
cout << s << ' ';
|
40
|
-
|
41
|
-
|
39
|
+
}
|
42
40
|
|
43
41
|
}
|
44
42
|
|