Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- #define N 1001
- using namespace std;
- char s[N], c[N],t[N];
- int n,m,k,i;
- int main()
- {
- cin>>s;
- cin>>c;
- n=strlen(s);
- m=strlen(c);
- if(n!=m) {cout<<"cod incorect"; return 0;}
- for(i=n-1;i>=0;i--)
- if(c[i]%2==0) ///'0' -48
- t[k++]=s[i];
- for(i=0;i<n;i++)
- if(c[i]%2==1)t[k++]=s[i];
- t[k]=NULL;
- cout<<t;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement