+ 1
Why the input commands don't work?
I just can't run my program and That's because I don't know how to write the Input commands here. I wrote "reader.nextInt();" But it didn't work.. https://code.sololearn.com/ck4Wqhdu1Ypm/?ref=app
3 Respostas
+ 3
here it is
import java.util.*;
public class Program
{
public static void main(String[] args) {
int Num, Max;
/* Hello, please follow the commands bellow~
*/
Scanner reader = new Scanner(System.in);
Num=reader.nextInt();
Max = reader.nextInt();
if(Num>Max)
Max=Num;
else
Max=Max;
}
}
+ 2
You haven't imported and instantiated Scanner Class
+ 1
Oh, thank you a lot.
I guess I used to write it without the System in command cause when we learn at school we write codes in our Notebooks.
Thank you for fixing my Program!