import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner x = new Scanner(System.in);//构造一个SCANNER对象,其传入参数为SYSTEM.IN int n = x.nextInt();//读取一个INT数值 int[] data = new int[20]; int i = 0, max = 0; while (n != 0) { data[i++] = n % 10; n = n / 10; } for ( int j =0; j < i; j++) { if (data[j] > max) max = data[j]; } System.out.println(max); } }