题解 | #计算商品打折结算金额#
计算商品打折结算金额
http://www.nowcoder.com/practice/055a92b5c93f497291a58c232f59fae9
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); double money=sc.nextDouble(); if(money>=5000){ System.out.printf("%.1f",money*0.6); }else if(money>=2000) { System.out.printf("%.1f",money*0.7); }else if(money>=500) { System.out.printf("%.1f",money*0.8); }else if(money>=100) { System.out.printf("%.1f",money*0.9); }else if(money>=0) { System.out.printf("%.1f",money); } } }