Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int num = 0;
- sent = "";
- for (int x = 0; x < nums.length; x++)
- {
- if (nums[x].matches("\\d+"))
- {
- num = Integer.parseInt(nums[x]);
- num = num * 2;
- nums[x] = Integer.toString(num);
- num = 0;
- }
- }
- if (word.length == 0)
- {
- sent = nums[0];
- }
- if (word.length > 0)
- {
- if (word[0].equals(""))
- {
- for(int a = 0; a < nums.length; a++)
- {
- sent = sent + nums[a];
- if (a < (nums.length))
- sent = sent + word[a + 1];
- }
- }
- else
- {
- for (int b = 0; b < word.length; b++)
- {
- sent = sent + word[b];
- if (b + 1 < (nums.length))
- sent = sent + nums[b + 1];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement