寻找变化前01序列(easy题)
#include<iostream>
using namespace std;
int main()
{
int n,size,i,cnt;
string str,ans;
cin >> n;
while(n--){
cin >> str;
size = str.size();
ans = "";
cnt = 0,i = 0;
while(i < size){
if(str[i] - '0' == 1)
cnt++;
else
cnt = 0;
ans = ans + str[i];
if(cnt == 5){
&n...
登录后发布评论
暂无评论,来抢沙发