The ninth question of Java Blue Bridge Cup 2014

Java guess age

American mathematician Wiener (N.Wiener) was precocious and went to university at the age of 11.
He was invited to give lectures at Tsinghua University in China from 1935 to 1936 .

Once, he was attending an important meeting, and his young face was striking. When asked about his age, he replied:

"My age cubed is a 4-digit number. My age is raised to the 4th power is a 6-digit number. The 10 numbers contain exactly 10 numbers from 0 to 9
, each of which occurs exactly once."

Please calculate how young he was at that time.

public static void main(String[] args) {
    
    
		for (int i = 5; i < 40; i++) {
    
    
			int a = i * i * i;
			int b = i * i * i * i;
			if (String.valueOf(a).length() == 4 && String.valueOf(b).length() == 6) {
    
    
				System.out.print(a + "" + b + "\t");
				System.out.print(i);
				System.out.println();
			}
		}
	}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325072928&siteId=291194637
Recommended