2-2-2 判断语句
</pre><pre name="code" class="javascript">public class Hello {
public static void main(String[] args) {
// TODO Auto-generated method stub
final int MINOR = 35;
System.out.print("输入年龄:");
Scanner in = new Scanner(System.in);
int age = in.nextInt();
System.out.println("你的年龄是"+age);
if( age < MINOR )
{
System.out.println("年轻是美好的,");
}
System.out.println("年轻决定了你的精神世界,好好珍惜吧");
}
}
临摹过程中
1.
if( age < MINOR )
多了个;
2.
System.out.println("你的年龄是"+age);
老师的是
System.out.print
自己求美观改成
System.out.println