Last active
February 29, 2016 18:36
-
-
Save Tiny-Giant/a74488a5b3a44be68264 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class interLeave | |
{ | |
public static void main(String[] args) | |
{ | |
String you = "hhhh"; | |
String me = "aaa"; | |
int length = Math.max(you.length(), me.length()); | |
for (int i = 0; i < length; i++) | |
{ | |
if (i < you.length()) | |
{ | |
System.out.print(you.charAt(i)); | |
} | |
if (i < me.length()) | |
{ | |
System.out.print(me.charAt(i)); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment