whl
小易喜欢的单词
http://www.nowcoder.com/questionTerminal/ca7b8af83e2f4ec1af2f23d6733223b5
import java.util.*;
public class Main {
public static boolean check(String str){
char[] ch = str.toCharArray();
for (int i=0;i<str.length();i++){
if(ch[i]>'Z'&&ch[i]<'A') return false;
}
for (int i=0;i<str.length()-1;i++){
if(ch[i]==ch[i+1]) return false;
}
//xyxy
for (int i=0;i<str.length()-3;i++){
for(int j=i+1;j<str.length()-2;j++){
for(int p=j+1;p<str.length()-1;p++){
if (ch[i]==ch[p]){
for (int q = p+1;q<str.length();q++){
if (ch[j]==ch[q]) return false;
}
}
}
}
}
return true;
}
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
String str = sc.nextLine();
if (check(str)){
System.out.println("Likes");
}else {
System.out.println("Dislikes");
}
}
}