int x = 0;
String[] QEquivalent = {};
String s = sc.nextLine();
String[] question2 = s.split(" ");
for (int i = 0; i < question2.length; i++) {
System.out.println(question2[i]);
x++;
} //debug
System.out.println(x);
String s2 = sc2.nextLine();
String[] Answer = s2.split(" ");
for (int c = 0; c < Answer.length; c++) {
System.out.println(Answer[c]);
} //debug
int y;
String u = sn.nextLine();
String[] t = u.split(" ");
for (y = 0; y < question2.length; y++) {
for (int w = 0; w < t.length; w++) {
if (t[w].equals(question2[y])) {
QEquivalent[y] = "ADJ";
System.out.println(QEquivalent[y]);
break;
}
}
}
这是我现在拥有的代码行。当在 String[] t 中找到有问题的字符串时,它应该将字符串“ADJ”存储在 String[] QEquivalent 中。我似乎无法修复错误。有人可以帮帮我吗?