아래 코드를 이해하려고하는데 아래의 3 항 연산자에 문제가 있습니다.3 진 연산자를 인식하고 변환하여 if 문을 수정하십시오.
System.out.print(solution[i][j] == 0
? " "
: Integer.toString(solution[i][j]));
이 정보가 맞습니까?
System.out.print(solution[i][j] == 0 ? " " : Integer.toString(solution[i][j]));
위의 문은 당신의 "이 맞습니까?",
if (solution[i][j] == 0) {
System.out.print(" ");
} else {
System.out.print(Integer.toString(solution[i][j]));
}
내게 맞습니다. – nitegazer2003