Auto commit

上级 5b0ce43e
import javax.swing.text.Element;
import javax.swing.text.DefaultStyledDocument.ElementSpec;
class Main { class Main {
public static void main(String[] args) { public static void main(String[] args) {
System.out.println("Hello world!"); //关于分支结构的一种例题:if elseif的Demo
double price = 300;
if(price>=2000){
price*=0.5;
}else if(price>=1000){
price*=0.7;
}else if(price>=500){
price*=0.8;
}else {
price*=0.9;
}
System.out.println("最终的消费金额为"+price);
} }
} }
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册