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