We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2773937 commit 0013f3dCopy full SHA for 0013f3d
Google-CodeJam/Problem A.cpp
@@ -0,0 +1,37 @@
1
+#include<iostream>
2
+#include<vector>
3
+
4
+using namespace std;
5
6
7
+int main() {
8
+ int t;
9
+ cin >> t;
10
11
+ for(int i = 0; i < t; i++) {
12
+ cout << "Case #" << i+1 << ": ";
13
14
+ string s;
15
+ cin >> s;
16
17
+ int n = s.size();
18
19
+ vector<int> other(n, 0);
20
21
+ for(int j = 0; j < n; j++) {
22
+ if(s[j] == '4') s[j] = '3', other[j] = 1;
23
+ }
24
25
+ cout << s << " " ;
26
27
28
+ int j;
29
+ for(j = 0; other[j] == 0 and j < n; j++);
30
+ for(; j < n; j++) cout << other[j];
31
+ cout << endl;
32
33
34
35
36
+ return 0;
37
+}
0 commit comments