Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package chapterSix;
- import java.util.Scanner;
- public class IntegerReaders
- {
- public static void main(String[] args)
- {
- Scanner s = new Scanner (System.in);
- System.out.println("Inputs:");
- int max = s.nextInt();
- int min = max;
- while (s.hasNextInt())
- {
- int input = s.nextInt();
- if (input > max)
- {
- max = input;
- }
- if (input < min)
- {
- min = input;
- }
- System.out.println("Max:"+ max);
- System.out.println("Min:" + min);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement