@java Blue Bridge Cup Group B Exercise Basics (30) Q7: special number
Keywords: digital loop judge
Resource constraints
Time limit: 1.0s Memory Limit: 512.0MB
Problem Description
153 is a very special number, which is equal to that of cubic and each digit, i.e., 153 = 1 . 1 1 + 5 . 5 5 + 3 . 3 3 All three decimal demand programming to meet this condition.
Output format
output three decimal number satisfying the condition in ascending order of each number per line.
Code
public class the Main {
public static void main (String [] args) {
fangFa ();
}
public static void fangFa () {
for (int I = 100; I <1000; I ++) {// find the number of qualifying and outputs
Bai = I int / 100;
int Si =% 100 I / 10;
int GE% I = 10;
IF (I == Bai Bai Bai + Si Si Si + GE GE GE) {
System.out.println (I);
}
}
}
}