Input in java?

can someone please show the java code for how to take in inputs and how to print the outputs in the exact same format using Scanner?please i m unable to do that.i am used to a System.out.print(“enter number”); int number = sc.nextInt(); format but this dosent work as i have to print nothing but the required answer

Read this articlefor fast i/o in java. link:Fast I/O in Java in Competitive Programming - GeeksforGeeks
Don’t print extra line such as “enter a number” only print which are required . Read the output section of the problem there you will get the information what you need to print.

1 Like