Advertisement
jakaria_hossain

codeforce - binary period

Apr 30th, 2020
354
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.52 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. #define ll long long
  4. #define fast()(ios_base::sync_with_stdio(0),cin.tie(NULL));
  5. int main()
  6. {
  7.     int t;
  8.     cin>>t;
  9.     while(t--)
  10.     {
  11.         string s;
  12.         cin>> s;
  13.         int i,len=s.size();
  14.         bool allpos=true;
  15.         for(i=0;i<len-1;i++)
  16.         {
  17.             if(s[i]!=s[i+1])allpos=false;
  18.  
  19.         }
  20.         if(allpos)cout<<s<<endl;
  21.         else
  22.         {
  23.             for(i=0;i<len;i++)cout<<"01";
  24.             cout<<endl;
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement