Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class E62 {
- public static void main(String[] args) {
- Scanner s = new Scanner(System.in);
- System.out.println("enter your input");
- String input = s.nextLine();
- for(int i=0; i < (input.length() - 2); i+=2)
- {
- char first = input.charAt(i);
- char second = input.charAt(i+2);
- if(first == second )
- {
- System.out.print(Character.toString(first));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment