veronikaaa86

02. Greater Number

Sep 17th, 2022
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.44 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class P02GreaterNumber {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.  
  7.         int firstNum = Integer.parseInt(scanner.nextLine());
  8.         int secondNum = Integer.parseInt(scanner.nextLine());
  9.  
  10.         if (firstNum > secondNum) {
  11.             System.out.println(firstNum);
  12.         } else {
  13.             System.out.println(secondNum);
  14.         }
  15.     }
  16. }
  17.  
Add Comment
Please, Sign In to add comment