daily pastebin goal
55%
SHARE
TWEET

Untitled

a guest Aug 10th, 2018 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.*;
  2. public class ExDod {
  3.  
  4.     static Scanner reader = new Scanner(System.in);
  5.     public static void main(String[] args)
  6.     {
  7.     boolean check=true;
  8.     String beta="", alpha;
  9.     System.out.println("Enter a sentence");
  10.     alpha = reader.next();
  11.     int p=0;
  12.     for(int i=0; i<p; i=i+p)
  13.     {
  14.         p = alpha.indexOf(" ",p+1);
  15.             if(alpha.charAt(i)!= alpha.charAt(i+p))
  16.                 check=false;
  17.             if(check)
  18.                 beta = alpha.substring(i, p)+" ";
  19.             check=true;
  20.                
  21.     }
  22.    
  23.     System.out.println("Beta");
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top