Advertisement
Guest User

Untitled

a guest
Nov 30th, 2015
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.63 KB | None | 0 0
  1. import java.io.BufferedReader;
  2. import java.io.InputStreamReader;
  3. import java.util.Arrays;
  4.  
  5. public class Test4
  6. {
  7.     public static void main(String[]args) throws Exception
  8.     {
  9.         BufferedReader b = new BufferedReader(new InputStreamReader(System.in));
  10.         char[]c = b.readLine().toCharArray();
  11.         Arrays.sort(c);
  12.         c = new StringBuilder(new String(c)).reverse().toString().toCharArray();
  13.  
  14.         int x = c[0] - c[c.length - 1];
  15.         if(x == 4 || x == 7)
  16.         {
  17.             System.out.println("YES");
  18.         }
  19.         else
  20.         {
  21.             System.out.println("NO");
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement