Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package TheFirst;
- /**
- * Created by Tarnovskiy on 28.05.2016.
- */
- import java.util.Arrays;
- import java.util.Scanner;
- public class MinMaxCalculator {
- public static void main(String[] args) {
- int[]ab;
- ab=new int[2];
- Scanner vvod = new Scanner(System.in);
- System.out.print("введите целое a: ");
- ab[0]=vvod.nextInt();
- System.out.print("введите целое b: ");
- ab[1]=vvod.nextInt();
- Arrays.sort(ab);
- int min=ab[0];int max=ab[1];
- System.out.println("min= "+min);
- System.out.println("max= "+max);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement