文章

25

粉丝

137

获赞

7

访问

119.4k

头像
寻找变化前01序列(easy题)
P1557 北京邮电大学机试题
发布于2022年3月17日 10:07
阅读数 5.1k

#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...

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发