题解 | #网购#

网购

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

#include<stdio.h> int main() { float price; int mouth,day,coupon; scanf("%f",&price); scanf("%d",&mouth); scanf("%d",&day); scanf("%d",&coupon); if(mouth == day && (mouth == 11 || mouth == 12) ) { if (mouth == 11) price = price * 0.7; if (mouth == 12) price = price *0.8; if(coupon) price = price -50; } if (price<0) printf("%.2f",0.00);

else
    printf("%.2f",price);
return 0;

}

全部评论

相关推荐

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