1. 程式人生 > >習題1-5

習題1-5

pre tdi turn print main else style \n ()

#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;
}

打折

習題1-5