sushmoyr

VRC

Jul 8th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5.     string s;
  6.     cin>>s;
  7.     int one=0;
  8.     for(int i=0; i<s.size(); i++)
  9.     {
  10.         if(s[i]=='1')
  11.             one++;
  12.     }
  13.     if(one%2)
  14.         s+='1';
  15.     else
  16.         s+='0';
  17.  
  18.     cout<<s<<endl;
  19. }
Add Comment
Please, Sign In to add comment