int main() {
float c; //衣服
int month, day;
int flag;
float money;
scanf("%f %d %d %d", &c, &month, &day, &flag);
if (month == 11 && day == 11) { //双11七折
money = c * 0.7;
if (flag == 1) {
money = money - 50;
if (money <= 0) { //如果小于0 商家不会做亏本生意
float money = 0;
printf("%.2f", money); //输出0
} else {
printf("%.2f", money); //如果不小于0输出折扣后减去优惠券的
}
}
else //与第一个if配对
{
printf("%.2f",money); //不在双11原价
}
}
//---------------------------------------------------------------------------
if (month == 12 && day == 12) { //双12八折
money = c * 0.8;
if (flag == 1) {
money = money - 50;
if (money <= 0) { //如果小于0 商家不会做亏本生意
float money = 0;
printf("%.2f", money); //输出0
} else {
printf("%.2f", money); //如果不小于0输出折扣后减去优惠券的
}
}
else
{
printf("%.2f",money); //不在双12原价
}
}
}