社区讨论

全wa,加了输出但不出结果

P1320压缩技术(续集版)参与者 2已保存回复 1

讨论操作

快速查看讨论及其快照的属性,并进行相关操作。

当前回复
1 条
当前快照
1 份
快照标识符
@locj6woe
此快照首次捕获于
2023/10/30 14:40
2 年前
此快照最后确认于
2023/11/05 01:59
2 年前
查看原帖
CPP
#include <bits/stdc++.h>
using namespace std;
char a[40010],str[210],s,f;
int n;
int main()
{
    cin>>str;
    n=strlen(str);
    strcat(a,str);
    for (int i=2;i<=n;i++)
    {
        cin>>str;
        strcat(a,str);
    }
    cout<<n<<' ';
    for (int i=0,n;i<=n*n;i++)
    {
        if (a[i]==a[i-1])
            s++;
        else
        {
            cout<<s<<' ';
            s=0;
        }
        f=!f;
    }
    return 0;
}

回复

1 条回复,欢迎继续交流。

正在加载回复...