题解 | #网购#

网购

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

public class Program{
    public static void Main()
    {
        string[] line = System.Console.ReadLine().Split(" ");

        double price = double.Parse(line[0]);
        int month = int.Parse(line[1]);
        int discount = int.Parse(line[3]);

        double pay = price;

        if(month==11)
        pay*=0.7;
        else if(month==12)
        pay*=0.8;

        if(discount==1)
        pay-=50;

        if(pay<=0)
        pay=0;

        System.Console.WriteLine(pay.ToString("F2"));
    }
}

全部评论

相关推荐

MingoTree:看不出你你的技术栈,想找什么工作,然后课设项目别写上去了,自我评价删了,前后端你想好你要干啥,这种简历投上去秒挂的
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务