Advertisement
SelinD

v88s3ex3

Mar 12th, 2019
91
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. using namespace std;
  3.  
  4. void numar(int n,int c1,int c2,int &x)
  5. {
  6. x=0;
  7. int c,p=1;
  8. while(n!=0)
  9. {
  10. c=n%10;
  11. if(c<c1 || c>c2)
  12. {
  13. x=x+p*c;
  14. p=p*10;
  15. }
  16. n=n/10;
  17. }
  18. }
  19. int main()
  20. {
  21. int n,x,c1,c2;
  22. cin>>n>>c1>>c2;
  23. numar(n,c1,c2,x);
  24. cout<<x;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement