Addition from time to time
BufferReeader
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line = br.readLine())
//Divided by spaces
String[] str = line.split(" ");
cast
//string->int
int i = Integer.parseInt(str);
Scanner
Scanner scanner = new Scanner(System.in);
・ Do not use break ・ BufferedReader from Scanner ・ When the order exceeds O (N²), it definitely looks like an out.
Recommended Posts