Advertisement
Guest User

i luv kimchi

a guest
Jan 26th, 2015
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.44 KB | None | 0 0
  1.                     int num = 0;
  2.                     sent = "";
  3.                     for (int x = 0; x < nums.length; x++)
  4.                     {
  5.                         if (nums[x].matches("\\d+"))
  6.                         {
  7.                             num = Integer.parseInt(nums[x]);
  8.                             num = num * 2;
  9.                             nums[x] = Integer.toString(num);
  10.                             num = 0;
  11.                         }
  12.                     }  
  13.                     if (word.length == 0)
  14.                     {
  15.                         sent = nums[0];
  16.                     }
  17.                     if (word.length > 0)
  18.                     {
  19.                         if (word[0].equals(""))
  20.                         {
  21.                             for(int a = 0; a < nums.length; a++)
  22.                             {
  23.                                 sent = sent + nums[a];
  24.                                 if (a < (nums.length))
  25.                                     sent = sent + word[a + 1];
  26.                             }
  27.                         }
  28.                         else
  29.                         {
  30.                             for (int b = 0; b < word.length; b++)
  31.                             {
  32.                                 sent = sent + word[b];
  33.                                 if (b + 1 < (nums.length))
  34.                                     sent = sent + nums[b + 1];
  35.                             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement