Jotoulane @ 2022-01-22 17:21:23
package P1320压缩技术续集版;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner reader=new Scanner(System.in);
String s1= reader.nextLine();//读取第一行
int n=s1.length();//获得一共几行
for(int i=1;i<n;i++){
s1+= reader.nextLine();
}
System.out.print(n+" ");//打印方阵行数
int count=0;
int num=1;
while (num<=n*n){
count++;
if(num==n*n){
System.out.println(count);
}else{
if(s1.charAt(num-1)!=s1.charAt(num)){
System.out.print(count+" ");
count=0;
}
}
num++;
}
}
}
by Yu_iscolongSUY @ 2022-01-22 18:29:17
wuwuwaaaa