ch1_6_5求解旋转词问题
import java.util.Scanner;
public class ch1_6_5求解旋转词问题 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner in=new Scanner(System.in);
int n=in.nextInt();
String s[]=new String[n];
String t[]=new String[n];
for(int i=0;i<n;i++) {
s[i]=in.next();
t[i]=in.next();
System.out.println((s[i].length()==t[i].length()&&(t[i]+t[i]).contains(s[i]))?"Yes":"No");
}
}
}