import java.util.*; class Main{ public static void main(String[] args) { int[] data = {1,2,3,4,5,6,7,8,9,10}; int Max = data[0]; int Min = data[0]; for(int i = 1 ; i < a.length; i++){ if(Max < data[i]){ Max = data[i]; }else if(Min > data[i]{ Min = data[i]; } } System.out.println(Max); } }
Recommended Posts