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