Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Arrays;
- public class Median {
- public static void main(String[] args) {
- int a = 2;
- int b = 3;
- int c = 5;
- int d = 7;
- int e = 11;
- int v[] = new int[10];
- v[0] = a * b;
- v[1] = a * c;
- v[2] = a * d;
- v[3] = a * e;
- v[4] = b * c;
- v[5] = b * d;
- v[6] = b * e;
- v[7] = c * d;
- v[8] = c * e;
- v[9] = d * e;
- Arrays.sort(v);
- System.out.println(Arrays.toString(v));
- System.out.println(v[(10 - 1) / 2] + ", " + v[10 / 2]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement