You are viewing a single comment's thread. Return to all comments →
Scanner sc = new Scanner(System.in); int n = sc.nextInt(); String s = Integer.toString(n);
if (s.equals(Integer.toString(n)) && (n >= -100 || n <= 100 )) { System.out.println("Good job"); } else { System.out.println("Wrong Answer"); }
Seems like cookies are disabled on this browser, please enable them to open this website
Java Int to String
You are viewing a single comment's thread. Return to all comments →
Scanner sc = new Scanner(System.in); int n = sc.nextInt(); String s = Integer.toString(n);