import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] s = br.readLine().split(" "); int len = s.length; int[] a = new int[len]; for (int i = 0; i < len; i++) { a[i] = Integer.parseInt(s[i]); } int maxindex = 0; for (int i = 0; i < len; i++) { if (a[i] > a[maxindex]) maxindex = i; } System.out.println("max=" + a[maxindex]); } }
import java.util.Scanner; import java.util.Arrays; public class Main{ public static void main(String[] args){ final int N =10; Scanner sc = new Scanner(System.in); while(sc.hasNext()){ int[] num = new int[N]; for(int i=0;i<N;i++){ num[i] = sc.nextInt(); } Arrays.sort(num); System.out.print("max="+num[N-1]); } } }
import java.util.Arrays;
import java.util.Scanner;
/**
* @author Allen_Hua
* @create_time 创建时间:May 12, 2018 7:57:42 PM 类说明
*/
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
while (scan.hasNext()) {
int[] data = new int[10];
for (int i = 0; i < data.length; i++) {
data[i] = scan.nextInt();
}
Arrays.sort(data);
System.out.println("max=" + data[data.length - 1]);
}
}
}