質問: new Scanner(System.in); int min =Integer.MAX_VALUE; while(stdin.hasNext()) { y =stdin.nextInt(); if(y
回答: 入力を2度行いたくないならこうする import java.util.Scanner; public class CalcFile{ public static void main(String[] args) { Scanner stdin = new Scanner(System.in); int max =Integer.MIN_VALUE,x; int min =Integer.MAX_VALUE; while(stdin.hasNext()) { x =stdin.nextInt(); if(x>max) max = x; if(x