Java development environment with simple Java program

Java development environment and test a simple Java program

First, the purpose of the experiment
are familiar with JDK development environment
master structured programming methods
Second, the experimental contents
1. Enter the title printout of all the "number of Narcissus", the so-called "number Narcissus" means a 3-digit number, which the digits cube and is equal to the number itself. For example, 153 is a "number daffodils."
2. Write a Java program, find the value of + 13-23 + 33-43 + 973-983 + 993-1003 ... of.
3. Programming seek 1! +2! +3! + ... + 20 !.
4. The write Java programs, calculation 8 + 88 + 888 + 10 ... and the front.
5. If a number is exactly equal to the sum of its factors, this number is called the complete number. All finished programming the number of output within 1000.
6. write applications, output meets + ... + n <maximum positive integer 1 + 2 + 3 8888.
7. Use for the print cycle following pattern.
Third, the experimental process

  1. Printout of all the "number of Narcissus", the so-called "number Narcissus" means a 3-digit number, which is equal to the digits of the cube and the number itself. For example, 153 is a "number daffodils."
    Experiments Source:

     package housewor;
    
     public class Shuixianhua {
    
     public static void main(String[] args) {
         // TODO Auto-generated method stub
         int a, b, c;
         for(int i=100;i<999;i++)
         {
             a=i/100;
             b=(i%100)/10;
             c=i%10;
             if(Math.pow(a, 3)+Math.pow(b, 3)+Math.pow(c, 3)==i)
             {
                 System.out.println(i);
             }
         }
     }
    
     }

The results:

Guess you like

Origin www.cnblogs.com/muxixixixi/p/11455694.html