求大神看看我这道题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
查看全部
qq_36204771
探索新路
2019/02/18 21:43
  • java
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

3个回复