Advertisement
Bene17

Untitled

Oct 17th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. //PROBLEMA 13
  2. #include<iostream>
  3. using namespace std;
  4. void numar(int n, int c1, int c2, int &x)
  5. { int r=0,k=1; x=0;
  6. while(n)
  7. { if (n%10<c1 || n%10>c2)
  8. {x=n%10*k+x; k=k*10;}
  9. n=n/10; }
  10. }
  11. int main()
  12. { int n,c1,c2,x;
  13. cin>>n;
  14. cin>>c1;
  15. cin>>c2;
  16. numar(n,c1,c2,x);
  17. cout<<x;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement