Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- prod_k#include <iostream>
- using namespace std;
- int main()
- {
- int n, k, c, P=1;
- bool ok=0;
- cin>>n>>k;
- while(n)
- {
- c=n%10;
- if(c!=k)
- {
- ok=1;
- P=P*c;
- }
- n=n/10;
- }
- if(ok==0)
- cout<<"0";
- else
- cout<<P;
- }
Advertisement
Add Comment
Please, Sign In to add comment