文章
2
粉丝
326
获赞
0
访问
21.1k
#include<bits/stdc++.h>
using namespace std;
int main(){
float moneyin=0,discount=0,pay=0;
while(scanf("%f",&moneyin)!=EOF){
if(moneyin>=5000)
{discount=0.8;pay=moneyin*discount;}
else if(moneyin>=3000)
{discount=0.85;pay=moneyin*discount;}
else if(moneyin>=2000)
{discount=0.9;pay=moneyin*discount;}
else if(moneyin>=1000)
{discount=0.95;pay=moneyin*discount;}
else
{discount=1;pay=moneyin*discount;}
printf("discount=%g,pay=%g",discount,pay);
}
}
登录后发布评论
暂无评论,来抢沙发