Since I started * AtCoder *, I will make a note of what I do not understand I use the Kansai dialect because I have a longing for the Kansai dialect
Class to get standard input Used when you want to do something with the acquired input information or in an interactive program
Scanner scanner = new Scanner(System.in);
System.out.println("Enter something");
String input = scanner.nextLine();
System.out.println(input + "Was entered");
scanner.close();
When you do this ...
Enter something
Is displayed, When you enter "Good morning"
Enter something
Good morning
Good morning was entered
Is displayed
Create an instance of Scanner class and specify System.in as an argument
You can get the input contents by using nextLine (). By the way, get the character string including spaces
Example) "Tomorrow is Arashi" ① With nextLine (), get "Tomorrow is Arashi" ② Get "Tomorrow" with next ()
Given the integers a, b, c and the string s. Display the calculation result of a + b + c and the character string s side by side.
Scanner scanner = new Scanner(System.in);
int a = scanner.nextInt();
int b = scanner.nextInt();
int c = scanner.nextInt();
String str = scanner.next();
System.out.println((a + b + c) + " " + str);
nextInt () receives a value of type int