package demo; import java.util.Scanner; public class DEMO1002 { static int N,i,max,min; static int a[]; public static void main(String[] args){ System.out.println("请输入数据!"); Scanner input=new Scanner(System.in); N=input.nextInt(); for(int i=0;i<N;i++){ a[i]=input.nextInt(); if(a[i]<a[i+1]){ max=a[i+1]; min=a[i]; } } System.out.println("这组数据中最大值为:"+max+" 这组数据中最小值为:"+min); } }
慕粉13431556588
Yexiaomo
蜂之谷
相关分类