This commit is contained in:
HuangHai
2025-08-30 18:35:01 +08:00
commit 1f397eca87
6258 changed files with 1487241 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
#include <bits/stdc++.h>
using namespace std;
const int N = 210;
string a[N]; //注意这里的是字符串数组!
int sum;
int main() {
cin >> a[0];
int n = a[0].size();//获取字符串的长度
for (int i = 1; i < n; i++) cin >> a[i];
printf("%d ", n);
char c = '0';
for (int i = 0; i < n; i++)
for (int j = 0; j < n; j++)
if (a[i][j] == c) sum++;
else {
printf("%d ", sum);
if (c == '0') c = '1'; else c = '0';
sum = 1;
}
//输出最后的个数
printf("%d ", sum);
return 0;
}