We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
This is a crazy task which I really don't understand. The requirement is really badly stated, or I'm just stupid. The following bit of code passes all tests, simply reading the input, ignoring the value and printing 'Good Job' regardless
Scanner scanner = new Scanner(System.in);
int b = scanner.nextInt();
try {
String str = String.valueOf(b);
System.out.println("Good job");
}
catch (Exception ex) {
System.out.println("Wrong Answer");
}
Cookie support is required to access HackerRank
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 →
This is a crazy task which I really don't understand. The requirement is really badly stated, or I'm just stupid. The following bit of code passes all tests, simply reading the input, ignoring the value and printing 'Good Job' regardless