Codice: Seleziona tutto
import prog.io.*;
public class maxmin {
public static void main(String[] args) {
// TODO Auto-generated method stub
ConsoleInputManager in = new ConsoleInputManager();
String s = in.readLine("inserire seq SOLO NUMERI");
int min = 10;
int max = 0;
for ( int i = 0; i < s.length(); i++){
char k = s.charAt(i);
if(Character.isDigit(k)){
int x = new Integer(s.charAt(i));
if(x>max)
max = k;
else
if(x<min)
min = k;
}
}
System.out.println(min + " e " + max);
}
}
