-4
//タイトル:1,2,3,4人の数字は、3桁の数字を繰り返さずにお互いの数を構成できますか?何人ですか?なぜ私はこのプロセスを実行できないのですか?私は3つを使用しますが、間違いを報告します
public class Eleven {
public static void main(String[] args) {
// Definition of one hundred , ten , a bit
// The first one hundred first statistics
for (int i = 1; i < 5; i++) {
// This bit is a one hundred
int bai = i;
for (int j = 1; j < 5 && (i != j); j++) {
int shi = j;
}
//Question1:Icannot understand it,Why it tell me mistake?a<5 &&(a !=bai &&(a !=shi)
for (int a = 1; a < 5 && (a != bai && (a != shi)); a++) {
int ge = a;
}
//Define a three-digit number , his output
int Threefingue = bai * 100 + shi * 10 + ge;
System.out.print(Threefingue);
}
}
}
エラーについての質問は、*完全な*エラーを完全かつ未編集で含めてください。あなたの質問を編集して、コンパイラやランタイムがあなたに言っていることを含めてください。 –
'shi'は2番目のforループのスコープ内で宣言されていますが、3番目のforの宣言ではアクセスできません。 –
どのようなエラーが表示されますか? –