Advertisement
Guest User

Untitled

a guest
May 31st, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. package TheFirst;
  2.  
  3. /**
  4. * Created by Tarnovskiy on 28.05.2016.
  5. */
  6.  
  7. import java.util.Arrays;
  8. import java.util.Scanner;
  9.  
  10. public class MinMaxCalculator {
  11. public static void main(String[] args) {
  12. int[]ab;
  13. ab=new int[2];
  14. Scanner vvod = new Scanner(System.in);
  15. System.out.print("введите целое a: ");
  16. ab[0]=vvod.nextInt();
  17. System.out.print("введите целое b: ");
  18. ab[1]=vvod.nextInt();
  19. Arrays.sort(ab);
  20. int min=ab[0];int max=ab[1];
  21. System.out.println("min= "+min);
  22. System.out.println("max= "+max);
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement