题解 | #发布信息#

网购

http://www.nowcoder.com/practice/5d7dfd405e5f4e4fbfdff6862c46b751

#include<stdio.h>
int main()
{
    double a = 0.0;
    int b, c, d;
    scanf("%lf%d%d%d", &a, &b, &c, &d);
    if (b == 11 && c == 11)
        a = a * 0.7;
    else if (b == 12 && c == 12)
        a = a * 0.8;
    else
    {
        a = a;
    }
    
    if (d == 1)
    {
        a = a - 50;
    }
    else
        a = a;
        if(a>0)
            printf("%.2lf", a);
        else
            printf("0.00");
    return 0;
}

全部评论

相关推荐

点赞 评论 收藏
分享
1 收藏 评论
分享
牛客网
牛客企业服务