Advertisement
Guest User

Untitled

a guest
Dec 10th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. package com.gmail.kudr641;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Example1Chapter2
  6. {
  7. public static void main(String[] args)
  8. {
  9. Scanner scanner = new Scanner(System.in);
  10.  
  11. System.out.println("Input a:");
  12. int max = scanner.nextInt();
  13.  
  14. System.out.println("Input b:");
  15. int b = scanner.nextInt();
  16.  
  17. System.out.println("Input c:");
  18. int c = scanner.nextInt();
  19.  
  20. System.out.println("Input d:");
  21. int d = scanner.nextInt();
  22.  
  23. scanner.close();
  24.  
  25. if(max < b){
  26. max = b;
  27. }if(max < c){
  28. max = c;
  29. }if(max < d){
  30. max = d;
  31. }
  32.  
  33. System.out.println("max: "+max);
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement