Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class RahadLub{
- public static void main(String[] args){
- Scanner inkey = new Scanner(System.in);
- String s = inkey.nextLine();
- String result = "";
- for(int i = 0; i < s.length() - 1; i++){
- String currentCharacter = s.substring(i, i + 1);
- String nextCharacter = s.substring(i + 1, i + 2);
- result += currentCharacter;
- if(currentCharacter.equals(nextCharacter)) result += "t";
- }
- result += s.substring(s.length() - 1, s.length());
- System.out.println(result);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement