离奇的错误
查看原帖
离奇的错误
348196
CZ_7楼主2021/1/1 21:30
#include<bits/stdc++.h>
using namespace std;
int n,a[10000],cnt,kk,ans;
char pp;
bool b;
int main(){
	freopen("text.in","r",stdin);
	freopen("text.out","w",stdout);
    while(cin>>pp){
    	cnt++;
    	a[cnt]=pp-'0';
	}
	kk=0;
	cout<<sqrt(cnt)<<' ';
	for(int i=1;i<=cnt;i++){
		//cout<<a[i]<<' ';
		if(a[i]!=a[i-1]){
			cout<<kk<<' ';
			kk=0;
		}
		kk++;
	}
	cout<<kk;
    return 0;
}
2021/1/1 21:30
加载中...