文章

28

粉丝

44

获赞

4

访问

6.0k

头像
促销计算 题解:
P1091 兰州大学机试题
发布于2024年3月3日 20:38
阅读数 226

#include<stdio.h>
int main()
{
    double count;
    scanf("%lf",&count);
    if(0<count&&count<=1000)
    {
        printf("discount=1,pay=%g\n",count);
    }
    if(1000<=count&&count<2000)
    {
        printf("discount=0.95,pay=%g\n",count*0.95);
    }
    if(2000<=count&&count<3000)
    {
        printf("discount=0.9,pay=%g\n",count*0.9);
    }
    if(3000<=count&&count<5000)
    {
        printf("discount=0.85,pay=%g\n",count*0.85);
    }
    if(count>=5000)
    {
    &...

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发