Advertisement
SergeyPGUTI

7.2.2

Nov 26th, 2015
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.45 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class Main {
  3.  
  4.  
  5.     static boolean IsDigit(char c)
  6.     {
  7.  
  8.         int a=(int) c;
  9.         if (a>=48 && a<=57) return true;
  10.         else return false;
  11.     }
  12.  
  13.     public static void main(String[] args) {
  14.         Scanner in = new Scanner(System.in);
  15.         String a=in.nextLine();
  16.         char b=a.charAt(0);
  17.         if (IsDigit(b)) System.out.println("YES");
  18.             else System.out.println("NO");
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement