package com.oned4z;
import java.util.Scanner;
/**
* @program: com.oned4z
* @description: 输入一批整数,输出最大最小值,输入0结束
* @author: Mr.Lin
* @create: 2019年7月4日
**/
public class One04 {
static Scanner sc = new Scanner(System.in);
public static void main(String[] args) {
System.out.println("请输入一个整数(输入0结束):");
int num = sc.nextInt();
int max = num;
int min = num;
while(num!=0) {
System.out.println("请输入一个整数(输入0结束):");
num = sc.nextInt();
if(num==0){
break;
}
if(num>max) {
max = num;
}
if(num<min) {
min = num;
}
}
System.out.println("最大值是:"+max);
System.out.println("最小值是:"+min);
}
}