求大神看看我这道题Java解法哪里错了

import java.util.Scanner;

public class Test {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int v = scanner.nextInt();
for (int n = 0; n < v; n++) {

        int a = scanner.nextInt();
        String[] list = new String[a];
        for (int i = 0; i < a; i++) {

            list[i] = scanner.next().toLowerCase();
        }
        int b = scanner.nextInt();
        String[] list2 = new String[b];
        for (int j = 0; j < b; j++) {
            list2[j] = scanner.next();
        }
        //String list1 = scanner.nextLine().toLowerCase();
        //String[] list2 = list1.split(" ");

        for (int k = 0; k < a; k++) {
            for (int f = 0; f < list2.length; f++) {
                if (list[k] == list2[f]) {
                    System.out.println("appeared");
                } else {
                    System.out.println("not appeared");
                }

            }
        }

    }

}

}





```这是题目的网址
http://acm.sustc.edu.cn/onlinejudge/problem.php?cid=1040&pid=0

小写变大写,但其他内容不能变

你转成小写就肯定错了,原本如果是SweepLine 然后句子里面有个词 sweepline你也会判appeared

有报错信息吗?

还有,一般for循环最多嵌套两层就可以了,嵌套三层或三层以上的就得考虑其他的解决方法了。