Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- void numar(int n,int c1,int c2,int &x)
- {
- x=0;
- int c,p=1;
- while(n!=0)
- {
- c=n%10;
- if(c<c1 || c>c2)
- {
- x=x+p*c;
- p=p*10;
- }
- n=n/10;
- }
- }
- int main()
- {
- int n,x,c1,c2;
- cin>>n>>c1>>c2;
- numar(n,c1,c2,x);
- cout<<x;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement