Minimum - Maximum - Quatre variables JAVA
}
lire.java
import java.io.IOException;
public class Lire
{
// Cette fonction permet de saisir au clavier une variable de type String public static String chaine() { String tmp = ""; char C='\0'; try { while ((C=(char) System.in.read()) !='\n') { if (C != '\r') tmp = tmp+C; } } catch (IOException e) { System.out.println("Erreur de frappe"); System.exit(0); } return tmp; }
// Cette fonction permet de saisir au clavier une variable entière de type byte public static byte entierByte() { byte x=0; try { x = Byte.parseByte(chaine()); } catch (NumberFormatException e) { System.out.println("Format numérique incorrect"); System.exit(0); } return x ; }
// Cette fonction permet de saisir au clavier une variable entière de type Short public static short entierShort() { short x=0; try { x=Short.parseShort(chaine()); } catch (NumberFormatException e) { System.out.println("Format numérique incorrect");