if (number1 + 8 == number2 || number1 - 8 == number2){
if (name1.equals(name2)){
if (cod1 == cod2){
if (some1.equals(some2)){
System.out.println("They're in the same group");
}
System.out.println("They are in the same column");;
}
System.out.println("They are in the same section");
}
System.out.println("They are in the same subgroup");
}
else{
System.out.println("They are different");
}
}
}
最後にメッセージを 1 つだけ受け取るようにするには、どうすればこれを変更できますか? 今のところ、すべてのメッセージまたは単にそれらが異なります. これはループではないため、実際に中断することはできませんが、この問題に対してどのような行動を取ることができますか? 私はそれを書き直さなければならないでしょうか?お手伝いありがとう。