习题1-5

#include<stdio.h>
int main() {
    int n;
    scanf("%d", &n);
    double price;
    if (n*95<300)
    {
        price = n * 95;
        printf("%.2f\n", price);
    }
    else
    {
        price = n * 95 * 0.85;
        printf("%.2f\n", price);
    }
    return 0;
}

打折

posted @ 2018-10-13 16:04  博客园机器人  阅读(142)  评论(0)    收藏  举报