#include <stdio.h>

//完成利润计算

int main()

{

    double i1 = 0, i2 = 0, i3 = 0, i4 = 0, i5 = 0, i6 = 0;

    double profit = 0;

    int money = 0;

    scanf("%d", &money);

    switch ((money - 1) / 100000)

        {  //我为何见大局逆转,因为switch可以穿透

            default:  //第六段大于一百万提成1%

            i6 = (money - 1000000) * 0.01;

            case 9://

            case 8://

            case 7://

            case 6://第五段600000 < *** <= 1000000提成1.5%

                if (money - 1000001 < 0)

                    i5 = (money - 600000) * 0.015;

                else

                    i5 = 6000;


            case 4://

            case 5://第四段400000 < *** <= 600000提成3%

                if (money - 600001 < 0)

                    i4 = (money - 400000) * 0.03;

                else

                    i4 = 6000;

            case 3://

            case 2://第三段200000 < *** <= 400000提成5%

                if (money - 400001 < 0)

                    i3 = (money - 200000) * 0.05;

                else

                    i3 = 10000;

            case 1://第二段100000 < *** <= 200000提成7.5%

                if (money - 200001 < 0)

                    i2 = (money - 100000) * 0.075;

                else

                    i2 = 7500;

            case 0://第一段0 < *** <= 100000提成10%

                if ((money - 100001) < 0)

                    i1 = money / 10;

                else

                    i1 = 10000;

            }

    profit = i1 + i2 + i3 + i4 + i5 + i6;

    printf("%0.0lf", profit);

    return 0;

}


点赞(0)
 

0.0分

4 人评分

C语言网提供由在职研发工程师或ACM蓝桥杯竞赛优秀选手录制的视频教程,并配有习题和答疑,点击了解:

一点编程也不会写的:零基础C语言学练课程

解决困扰你多年的C语言疑难杂症特性的C语言进阶课程

从零到写出一个爬虫的Python编程课程

只会语法写不出代码?手把手带你写100个编程真题的编程百练课程

信息学奥赛或C++选手的 必学C++课程

蓝桥杯ACM、信息学奥赛的必学课程:算法竞赛课入门课程

手把手讲解近五年真题的蓝桥杯辅导课程

评论列表 共有 0 条评论

暂无评论