1 Star 0 Fork 0

SagamiYun/牛客网入门题目代码

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
网购 787 Bytes
一键复制 编辑 原始数据 按行查看 历史
SagamiYun 提交于 2021-05-22 17:48 +08:00 . add 网购.
#include<stdio.h>
int main(){
double price = 0;
int month = 0;
int day = 0;
int flag = 0;
double cut = 1.0;//折扣
double last =0.0 ;
scanf("%lf %d %d %d %d",&price,&month,&day,&flag);
if(month==11 && day==11)
{
cut = 0.7;
if(flag==1)
{
last = price*cut-50;
}
else
{
last = price*cut;
}
}
else if(month==12 && day==12)
{
cut = 0.8;
if(flag==1)
{
last = price*cut-50;
}
else
{
last = price*cut ;
}
}
if(last<0.0)
{
printf("%.2lf\n",0.0);
}
else
{
printf("%.2lf\n",last);
}
return 0;
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/sagamiyun/niukecom-entry-title-code.git
git@gitee.com:sagamiyun/niukecom-entry-title-code.git
sagamiyun
niukecom-entry-title-code
牛客网入门题目代码
master

搜索帮助