文章
105
粉丝
69
获赞
117
访问
57.2k
#include<bits/stdc++.h>
using namespace std;
float x, d, p;
int main()
{
while(cin >> x)
{
d = 1, p = x;
if(x >= 1000 && x < 2000)
d = 0.95, p *= d;
else if(x >= 2000 && x < 3000)
d = 0.9, p *= d;
else if(x >= 3000 && x < 5000)
d = 0.85, p *= d;
else if(x >= 5000)
d = 0.8, p *= d;
cout << "discount=" << d << "," << "pay=" << p << endl;
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发