解题思路: 注意事项: 参考代码: #include<cstdio> #include<iostream> using namespace std; int main() { int price=0,gold=0; int p1=100000,p2=200000,p4=400000,p6=600000,p10=1000000; cout<<"please money="; cin>>price; if(price<=p1) //小于10万 gold =price*0.1; if(price>p1 && price<=p2) //10万-20万 gold = p1*0.1+(price-p1)*0.075; if(price>p2 && price<=p4 )//20万-40万 gold = p1*0.1+(p2-p1)*0.075+(price-p2)*0.05; if(price>p4 && price<=p6 )//40万-60万 gold = p1*0.1+(p2-p1)*0.075+(p4-p2)*0.05+(price-p4)*0.03; if(price>p6 && price<=p10 )//60万-100万 gold = p1*0.1+(p2-p1)*0.075+(p4-p2)*0.05+(p6-p4)*0.03+(price-p6)*0.015; if(price>1000000 )//大于100万 gold = p1*0.1+(p2-p1)*0.075+(p4-p2)*0.05+(p6-p4)*0.03+(p10-p6)*0.015+(price-p10)*0.01; cout<<gold; return 0; }
0.0分
0 人评分
众数问题 (C++代码)浏览:1288 |
C语言程序设计教程(第三版)课后习题10.2 (C语言代码)浏览:1055 |
输出九九乘法表 (C语言代码)浏览:582 |
2^k进制数 (C++代码)使用递归方法浏览:736 |
【明明的随机数】 (C++代码)浏览:834 |
兰顿蚂蚁 (C++代码)浏览:1225 |
C语言训练-亲密数 (C语言代码)浏览:697 |
A+B for Input-Output Practice (C语言代码)浏览:505 |
小九九 (C语言描述,不看要求真坑爹)浏览:1006 |
C语言训练-亲密数 (C语言描述,反正怎么都能对)浏览:2256 |