Advertisement
nullzero

RahadLub

Jul 14th, 2012
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.67 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class RahadLub{
  4.         public static void main(String[] args){
  5.                 Scanner inkey = new Scanner(System.in);
  6.                 String s = inkey.nextLine();
  7.         String result = "";
  8.                 for(int i = 0; i < s.length() - 1; i++){
  9.                         String currentCharacter = s.substring(i, i + 1);
  10.                         String nextCharacter = s.substring(i + 1, i + 2);
  11.             result += currentCharacter;
  12.                         if(currentCharacter.equals(nextCharacter)) result += "t";
  13.                 }
  14.         result += s.substring(s.length() - 1, s.length());
  15.                 System.out.println(result);
  16.         }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement