题解 | #网购#

网购

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

#include <stdio.h>

int main() {
    int b, c, d;
    double a, goal;
    while (scanf("%lf %d %d %d", &a, &b, &c, &d) != EOF) {
        if (b == 12 && c == 12) {
            goal = a * 0.8;
            if (d == 1) {
                goal -= 50;
            }
        }
        if (b == 11 && c == 11) {
            goal = a * 0.7;
            if (d == 1) {
                goal -= 50;
            }
            if(goal<=0)
            {
                goal=0;
            }
        }

        printf("%.2f", goal);
    }
    return 0;
}

全部评论

相关推荐

11-08 10:39
门头沟学院 C++
点赞 评论 收藏
分享
accaacc:2到4k,不是2k到4k,所以年薪是30块
点赞 评论 收藏
分享
评论
点赞
收藏
分享
牛客网
牛客企业服务