Skip to content

Commit

Permalink
11830 solved
Browse files Browse the repository at this point in the history
  • Loading branch information
ksaveljev committed Apr 14, 2011
1 parent 3b756c7 commit 9182d47
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions 11830.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#include <iostream>
#include <string>
using namespace std;

int main(void) {
char n;
bool first;
string contract;

while (cin >> n >> contract) {
if (n == '0' && contract == "0")
break;

first = true;
for (int i = 0, sz = contract.size(); i < sz; i++) {
if (contract[i] == n)
continue;

if (contract[i] == '0') {
if (first)
continue;
}

cout << contract[i];
first = false;
}

if (first)
cout << 0;

cout << endl;
}

return 0;
}

0 comments on commit 9182d47

Please sign in to comment.