import java.util.Scanner;
public class Solution {
static int N = 30;
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
for(int t=1;t<=T;t++) {
String s = sc.next();
String[] arr = s.split("");
int j=0;
for(int i=1;i<N;i++) {
if(arr[j].equals(arr[i])) j++;
else j=0;
}
System.out.println("#"+t+" "+(N-j));
}
}
}
'JAVA 알고리즘 ' 카테고리의 다른 글
SWEA 1979 어디에 단어가 들어갈 수 있을까 (0) | 2020.01.27 |
---|---|
SWEA 9229. 한빈이와 Spot Mart (0) | 2020.01.25 |
SWEA 1989. 초심자의 회문 검사 (0) | 2020.01.25 |
SWEA 1926. 간단한 369게임 (2) | 2020.01.25 |
SWEA 2025 N줄덧셈 (0) | 2020.01.19 |