Loading

Problem 1342B - Binary Period (思维)

AC代码:

#include<bits/stdc++.h>
using namespace std;
int main() {
	//freopen("in.txt", "r", stdin);
	ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	int t; cin >> t;
	while (t--) {
		string s, a = ""; cin >> s;
		for (auto p : s)
			a += "01";
		if (s.find('0') == string::npos || s.find('1') == string::npos)
			cout << s << endl;
		else cout << a << endl;
	}
}
posted @ 2020-09-02 11:03  RioTian  阅读(171)  评论(0)    收藏  举报