我正试图从用户那里得到3个不同的输入,然后将它们打印成一行,以获得“牛跳过月球”之类的结果。我是Java的新手,并不太了解如何正确打印这些变量。有人可以帮忙吗?
import java.util.Scanner;
public class test_input {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("Enter the first noun: ");
String n = scan.nextLine();
System.out.println("Enter the second noun: ");
String a = scan.nextLine();
System.out.println("Enter a verb: ");
String v = scan.nextLine();
System.out.println("The" +n +v "over the" +a);
}
}