昨日コーディングについて学び始めたばかりで、今日、特定の数までのすべての完全数を見つけるのに役立つプログラムを作成したいと考えていました。これらは機能しません。Eclipse ではエラー メッセージが表示されないので、間違いは論理的なものだと思います (?) 関連するコードは次のとおりです。誰かエラーの場所を教えてください。
protected void actionPerformedProcessBtn(ActionEvent arg0) {
txtS.setText("");
int limit = Integer.parseInt(txtAmmount.getText()), a = 1, b = 1, c = 0;
while (a <= limit) {
while(a > b) {
if (a % b != 0) {
b++;
}
else {
c = c + b;
b++;
}
}
if (c == a)
txtS.append(a + "\n");
a++;
}
}
void ActionPerformedDoBtn(ActionEvent arg0) {
int c = 1, d, e;
txtS.setText("");
while (c <= 1000) {
d = 0;
e = 0;
while(d < c) {
if(c % d == 0)
e += d;
d++;
}
if (e == c)
txtS.append("Perf Num:" + c);
c++;
}
}