Advertisement
edutedu

cifra c

Sep 23rd, 2018
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. int n,c,ok=0,m=0,p=1,cifra;
  2. cin>>n>>c;
  3. while(n)
  4. {
  5. cifra=n%10;
  6. if(cifra!=c)
  7. {
  8. m+=p*cifra;
  9. p*=10;
  10. ok=1;
  11. }
  12. n=n/10;
  13. }
  14. if(ok==1)
  15. cout<<m;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement