Advertisement
tunerkelley

Problem 1.4.12

Feb 8th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class Problem12 {
  2.    
  3.     public void printarrays(int[] jhin, int[] yasuo){
  4.         int x = 0
  5.         int y = 0
  6.         while (x < jhin.length || y < yasuo.length){
  7.             if (x == jhin.length) {
  8.                 System.out.print(yasuo[y]);
  9.                 y++;
  10.             }
  11.             else if (y == yasuo.length) {
  12.                 System.out.print(jhin[x]);
  13.                 x++;
  14.             }
  15.             else{
  16.                 if (jhin[x] <= yasuo[y]) {
  17.                     System.out.print(jhin[x]);
  18.                     x++;
  19.                 }
  20.                 else{
  21.                     System.out.print(yasuo[y]);
  22.                     y++;
  23.                 }
  24.             }
  25.         }  
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement