Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Scanner sc = new Scanner(System.in);
- int x = sc.nextInt();
- int[][] numberPair = new int [2][x];
- for(int i=0; i<x; i++){
- for(int k=0; k<2; k++){
- numberPair[k][i] = sc.nextInt();
- }
- }
- int[] solution = new int[x];
- for(int i=0; i<x; i++){
- if(numberPair[0][i]<numberPair[1][i]){
- //a minimum
- solution[i] = numberPair[0][i];
- }
- else {
- //b min
- solution[i] = numberPair[1][i];
- }
- for(i=0; i<x; i++)
- System.out.printf(solution[i] + " ");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement