View Code of Problem 70

#include <stdio.h>
#include <string.h>
#include <math.h>
#define N 100
//企业发放的奖金根据利润提成。
//
//利润低于或等于100000元的,奖金可提10% ;
//
//利润高于100000元,低于200000元(100000 < I≤200000)时,低于100000元的部分按10%提成,高于100000元的部分,可提成 7.5 % ;
//
//	200000 < I≤400000时,低于200000元部分仍按上述办法提成,(下同),高于200000元的部分按5%提成;
//
//	400000 < I≤600000元时,高于400000元的部分按3%提成;600000 < I≤1000000时,高于600000元的部分按1.5 % 提成;
//
//	I>1000000时,超过1000000元的部分按1 % 提成。
//
//	从键盘输入当月利润I, 求应发奖金总数。
int main()
{
	int a;
	int s;
	scanf("%d", &a);
	if (a <= 100000)
	{
		s = a * 0.1;
		printf("%d", s);
	}
	else
		if (a <= 200000)
		{
			s = (a - 100000) * 0.75 + 10000;
			printf("%d", s);
		}
		else
			if (a <= 400000)
			{
				s = (a - 100000) * 0.75 + 10000;
				printf("%d", s);
			}
			else
				if (a <= 600000)
				{
					s = (a - 400000) * 0.3 + 27500;
					printf("%d", s);
				}
				else
					if (a <= 1000000)
					{
						s = (a - 600000) * 0.015 + 33500;
						printf("%d", s);
					}
	if (a > 1000000)
	{
		s = (a - 1000000) * 0.01 + 42500;
		printf("%d", (a-1000000) * 0.01+42500);
	}
}

Double click to view unformatted code.


Back to problem 70