Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main() {
- int n, k;
- cin >> n >> k;
- int _max = 0, i = 0;
- int ans = 0;
- while (n > 0) {
- if (n % 10 != k) {
- // cout << ans << endl;
- // cout << n % 10 * pow(10, i) << endl;
- // cout << ans + n % 10 * pow(10, i) << endl;
- ans += n % 10 * pow(10, i);
- ++i;
- }
- n /= 10;
- }
- if (ans) {
- cout << ans;
- } else {
- cout << "NO";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement