Title: My Age Cube is a 4-digit number. My 4-time-old is a 6-digit number. These 10 numbers contain exactly 10 numbers from 0 to 9, each of which happens 1 times to find out how old I am this year.
Direct copy operation is possible.
Public classAge { Public Static voidMain (string[] args) {//TODO auto-generated Method StubAge A =NewAge (); A.fun (); } Private intFun () { for(inti = 0;i<60;i++){ if((i*i*i)/1000>0 && (i*i*i*i)/100000>0) {String A1= (i*i*i) + ""; String A2= (i*i*i*i) + ""; string[] Str= (A1+A2). Split (""); if(Panduan (str)) {SYSTEM.OUT.PRINTLN ("This 10-digit number is" + (a1+A2)); System.out.println (i); return1; } } } return-1; } Private BooleanPanduan (string[] str) { for(inti = 0;i<10;i++){ for(intj = i+1;j<10;j++){ if(Str[i] = =Str[j]) { return false; } } } return true; }}
The output is:
This 10-digit number is 5832104976.
18
--------------------------------
The final answer is 18 years old.
Java programming to find the age