Analysis of Java cycle exercises
This article mainly explains "Java cycle exercise Analysis". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn the "Java cycle exercise Analysis"!
1. Calculate the number of daffodils
Print out all the "daffodils". The so-called "daffodils" refers to a three-digit number.
The sum of the digital cubes is equal to the number itself.
For example, 153 is a "number of daffodils"
Because 153 times 1 to the third power + 5 to the third power + 3 to the third power.
/ / first question, the number of daffodils public class demo4 {public static void main (String [] args) {System.out.println ("numbers up to 1000"); int upright 0; for (int iTunes 100th I)