Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- import java.util.*;
- class Solution {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- int max;
- System.out.print("จำนวนที่ 1 >>");
- int n1 = scan.nextInt();
- max = n1;
- System.out.print("จำนวนที่ 2 >>");
- int n2 = scan.nextInt();
- max = (n2 > max)? n2 : max;
- System.out.print("จำนวนที่ 3 >>");
- int n3 = scan.nextInt();
- max = (n3 > max)? n3 : max;
- System.out.println("\nจำนวนที่มากที่สุด: " + max);
- scan.close();
- }
- }
Add Comment
Please, Sign In to add comment