请教一下需要改进的地方,老师。
来源:2-5 编程练习
o一只猫o
2019-10-25 18:25:26
public class IfElseDemo {
public static void main(String[] args) {
int x=-5,y=0;
System.out.print("x="+x+",");
if (x<0){
System.out.print("y="+y);
}else if(x==0){
System.out.print("y="+y);
}else {
System.out.print("y="+y);
}
}
}1回答
同学你好,代码完成的很好,继续努力
如果我的回答解决了你的疑惑,请采纳!祝学习愉快!
相似问题