Answer the question
In order to leave comments, you need to log in
Why are numbers and symbols added in the program?
There is a code
package testproject;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
try(Scanner input = new Scanner(System.in)) {
String name, surname;
int year, years;
System.out.println("Привет, как тебя зовут?");
name = input.nextLine();
System.out.println("Очень приятно "+name+" а у тебя есть фамилия?");
surname = input.nextLine();
System.out.println("Мне очень приятно с тобой познакомиться "+name+" "
+ ""+surname+" а меня зовут Тоша, в каком году ты родился?");
year = input.nextInt();
System.out.println("Я так и предполагал! "+name+" если не трудно напомни "
+ "мне какой сейчас год?");
years = input.nextInt();
System.out.println("Так, так, так.. Если ты "+year+" года, а сейчас "
+ ""+years+" год, получается тебе "+(year-years)+" верно?");
}
}
}
Hello what is your name?
Nem
Very nice Nem do you have a surname?
Yum
It's a pleasure to meet you Nem Yum and my name is Tosha, what year were you born?
1996
I thought so! If it's not difficult, remind me what year it is?
2019
So, so, so.. If you are 1996, and now 2019, it turns out you are -23 right?
ASSEMBLY COMPLETED SUCCESSFULLY (total time: 26 seconds)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question