Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- string s;
- cin>>s;
- int one=0;
- for(int i=0; i<s.size(); i++)
- {
- if(s[i]=='1')
- one++;
- }
- if(one%2)
- s+='1';
- else
- s+='0';
- cout<<s<<endl;
- }
Add Comment
Please, Sign In to add comment