Advertisement
Guest User

Untitled

a guest
May 20th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6. int n, k, p = 1, c, nr;
  7. cin >> n >> k;
  8. nr = 0;
  9. while (n) {
  10. c = n % 10;
  11. if (c != k) {
  12. nr++;
  13. p *= c;
  14. }
  15. n /= 10;
  16. }
  17. if (nr == 0)
  18. cout << 0;
  19. else
  20. cout << p;
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement