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