i legit cant know where the issue with my code is, can someone tell me where is the issue?
public class Problem6
{
public static void main(String[] args)
{
final int x = 10;
int B;
int C = 0;
int D;
for (int i = 100; i <= 999; i++)
{
D = i;
while(10 <= D)
{
B = D%10;
D /= 10;
C += B * B * B;
}
C += D * D * D;
if ( C == i)
{
System.out.println(i + " is an Armstrong ");
}
else
{
continue;
}
}
}
}
Aucun commentaire:
Enregistrer un commentaire