18340006072 提交的代码
提交时间:2021年3月21日 09:45 语言:C++运行时间:0ms占用内存:253K
运行状态: Accepted
题目:促销计算1091

大会员可查看代码,点此开通大会员

                
                    #include<bits/stdc++.h>

using namespace std;

int main(){
	double x;
	while(cin>>x){
		if(x<1000){
			printf("discount=1,pay=%g\n",x);
		}
		else if(x>=1000&&x<2000){
			printf("discount=0.95,pay=%g\n",x*0.95);
		}
		else if(x>=2000&&x<3000){
			printf("discount=0.9,pay=%g\n",x*0.9);
		}
		else if(x>=3000&&x<5000){
			printf("discount=0.85,pay=%g\n",x*0.85);
		}
		else{
			printf("discount=0.8,pay=%g\n",x*0.8);
		}
	}
	return 0;
}