Advertisement
a53

prod_k

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