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