题解 | #网购#

网购

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

#include <stdio.h>
int main()
{
	double price = 0.0;
	int month = 0;
	int day = 0;
	int discount = 0;
	double count = 0.0;
	scanf("%lf %d %d %d",&price,&month,&day,&discount);
	if (month == 11 && day == 11)
	{
		count = price*0.7;
		if (discount == 1)
		{
			count -= 50;
		}
	}
	else if (month == 12 && day == 12)
	{
		count = price*0.8;
		if (discount == 1)
		{
			count -= 50;
		}
	}
	if (count <= 0)
	{
		count = 0.0;
	}
	printf("%0.2lf", count);
	return 0;
}

全部评论

相关推荐

不愿透露姓名的神秘牛友
昨天 11:15
点赞 评论 收藏
分享
fRank1e:吓得我不敢去外包了,但是目前也只有外包这一个实习,我还要继续去吗
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务