Java Fundamentals (fifth post-course assignments) 03

Source: Internet
Author: User

1  PackageCom.xunhuan;2 3 ImportJava.util.Scanner;4 5  Public classZuoYe03 {6 7 8      Public Static voidMain (string[] args) {9Scanner meng00=NewScanner (system.in);Ten           One          A         intmun; -         intMax=0; -         intMin=0; the          -         //Enter Do...while loop output -          Do { -System.out.println ("Please enter a number (enter 0 to end)"); +Mun =meng00.nextint (); -             if(mun!=0) {//If you determine the number of inputs if not equal to 0, enter +                 if(Mun>max) {//if the number of inputs is determined to be greater than the set maximum value, the value is assigned to the maximum value Amax=mun; at                 } -                  -                 if(mun<min) {//If the number entered is less than the minimum value, the value is assigned to the minimum value -min=mun; -                 } -                 if(min==0) {//If the minimum value is 0, then the input number is assigned to the minimum value inmin=mun; -                 } to                              +             } -                          the} while(mun!=0);//the number entered cannot be 0, which is 0 to end the loop operation *System.out.print ("Maximum value is:" +max); $System.out.print ("Minimum value is:" +min); Panax Notoginseng } -}

Java Fundamentals (fifth post-course assignments) 03

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.