Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package whileLoop;
- import java.util.Scanner;
- public class P07MinNumber {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String input = scanner.nextLine();
- int minNum = Integer.MAX_VALUE;
- while (!input.equals("Stop")){
- int num = Integer.parseInt(input);
- if (num < minNum) {
- minNum = num;
- }
- input = scanner.nextLine();
- }
- System.out.println(minNum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement