-
-
Notifications
You must be signed in to change notification settings - Fork 81
Expand file tree
/
Copy pathcontract_revision.cpp
More file actions
31 lines (21 loc) · 674 Bytes
/
Copy pathcontract_revision.cpp
File metadata and controls
31 lines (21 loc) · 674 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// https://www.urionlinejudge.com.br/judge/en/problems/view/1120
#include <iostream>
#include <string>
using namespace std;
int main() {
string error_num, contract_num, result = "";
cin >> error_num >> contract_num;
while (error_num != "0" || contract_num != "0") {
for (int i = 0; i < contract_num.size(); i++) {
if (error_num[0] != contract_num[i]) {
if (result.size() > 0) result += contract_num[i];
else if (contract_num[i] != '0') result += contract_num[i];
}
}
if (result.size() > 0) cout << result << endl;
else cout << 0 << endl;
result.clear();
cin >> error_num >> contract_num;
}
return 0;
}