public class HelloWorld {
public static void main(String[] args) {
int age=25;
if (age>=18){
System.out.println("成年")
}else{
System.out.println("未成年")
}
}
}
1 回答
frece
TA贡献36条经验 获得超15个赞
错误是因为你没写分号,并不是因为中文
正确代码:
public static void main(String[] args) { int age=25; if (age>=18){ System.out.println("成年"); }else{ System.out.println("未成年"); } /** * 输出结果: * 成年 */ }
添加回答
举报
0/150
提交
取消