Guest User

Untitled

a guest
Feb 24th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. import java.io.*;
  2. import java.util.*;
  3.  
  4. class Solution {
  5. public static void main(String[] args) {
  6. Scanner scan = new Scanner(System.in);
  7. int max;
  8. System.out.print("จำนวนที่ 1 >>");
  9. int n1 = scan.nextInt();
  10. max = n1;
  11. System.out.print("จำนวนที่ 2 >>");
  12. int n2 = scan.nextInt();
  13. max = (n2 > max)? n2 : max;
  14. System.out.print("จำนวนที่ 3 >>");
  15. int n3 = scan.nextInt();
  16. max = (n3 > max)? n3 : max;
  17.  
  18. System.out.println("\nจำนวนที่มากที่สุด: " + max);
  19. scan.close();
  20. }
  21. }
Add Comment
Please, Sign In to add comment