主题:[讨论]高手讲解下~~谢谢!!!
[size=1][size=6][b][i][b][color=FF0000]高手给讲解下为什么这个程序输出的是“what is you name?”怎么不是("What is your name?"),("How old are you?"),("Hello,"+name+".Next year you'll be"+(age+1))呢?[/color][/b][/i][/b][/size][/size]
import java.util.*;
public class ha {
public static void main(String[] args) {
Scanner in=new Scanner(System.in);
System.out.print("What is your name?");
String name=in.nextLine();
System.out.print("How old are you?");
int age=in.nextInt();
System.out.println("Hello,"+name+".Next year you'll be"+(age+1));
}
}
import java.util.*;
public class ha {
public static void main(String[] args) {
Scanner in=new Scanner(System.in);
System.out.print("What is your name?");
String name=in.nextLine();
System.out.print("How old are you?");
int age=in.nextInt();
System.out.println("Hello,"+name+".Next year you'll be"+(age+1));
}
}