x978378992


私信TA

用户名:Fount

访问量:1843

签 名:

等  级
排  名 34625
经  验 398
参赛次数 1
文章发表 3
年  龄 0
在职情况 学生
学  校 燕大
专  业

  自我简介:

解题思路:
利用if else if语句,不知道为什么在网站上总是报错,有大神可以帮忙看下吗?感谢





注意事项:




参考代码:

#include <stdio.h>

int main()

{

int l,t;

printf("请输入这个月的利润:");

scanf("%d",&l);


if(l<=10000)

{ t=(int)(l*0.1);

printf("%d\n",t);

}

else if(l>10000&&l<=20000)

{ t=(int)((l-10000)*0.075+10000*0.1);

printf("%d\n",t);

}

else if(l>20000&&l<=40000)

{

t=(int)(10000*0.075+10000*0.1+(l-20000)*0.05);

t=

printf("%d\n",t);

}

else if(l>40000&&l<=60000)

{

t=(int)(10000*0.075+10000*0.1+20000*0.05+(l-40000)*0.03);

printf("%d\n",t);

}

else if(l>60000&&l<=100000)

{

t=(int)(10000*0.075+10000*0.1+20000*0.05+40000*0.03+(l-60000)*0.015);


printf("%d\n",t);

}

else 

{ t=(int)(10000*0.075+10000*0.1+20000*0.05+40000*0.03+60000*0.015+(l-100000)*0.01);

printf("%d\n",t);

}

return 0;



}


 

0.0分

0 人评分

看不懂代码?想转换其他语言的代码? 或者想问其他问题? 试试问问AI编程助手,随时响应你的问题:

编程语言转换万能编程问答  

代码解释器

代码纠错

SQL生成与解释

  评论区