Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.47 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class Salary
  3. {
  4.     public static void main (String[] args)
  5.     {
  6.        
  7.         Scanner input = new Scanner(System.in);
  8.         System.out.print("Hai");
  9.         String chunk;
  10.         chunk = input.nextLine();
  11.         int chunkLength = chunk.length();
  12.         char firstChar = chunk.charAt(0);
  13.         char lastChar = chunk.charAt(chunkLength);
  14.         if (firstChar == ':' && lastChar == ':')
  15.         {
  16.             System.out.println("Win");
  17.         }
  18.         else
  19.         {
  20.             System.out.println("Fail");
  21.         }
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement