PAT:分支-10. 计算个人所得税(10) AC

#include<stdio.h>
int main()
{
double x;
scanf("%lf",&x);
if(x<=1600)
printf("%.2lf\n",x*0);
else if(x<=2500)
printf("%.2lf\n",(x-1600)*0.05);
else if(x<=3500)
printf("%.2lf\n",(x-1600)*0.1);
else if(x<=4500)
printf("%.2lf\n",(x-1600)*0.15);
else
printf("%.2lf\n",(x-1600)*0.2);
return 0;
}

时间: 2024-08-25 14:20:42

PAT:分支-10. 计算个人所得税(10) AC的相关文章

分支-10. 计算个人所得税(10)

#include<iostream>#include<iomanip>using namespace std;int main(){    float x;    cin>>x;    cout<<setiosflags(ios::fixed)<<setprecision(2);    if(x<=1600)        cout<<0.00<<endl;    else if(x<=2500)      

分支-10. 计算个人所得税

1 /* 2 * Main.c 3 * B10-分支-10. 计算个人所得税(10) 4 * Created on: 2014年5月29日 5 * Author: Boomkeeper 6 * 7 * 测试通过 8 */ 9 10 11 #include <stdio.h> 12 #include <stdlib.h> 13 14 int main() 15 { 16 float salary=0; 17 float *ps=&salary; 18 19 scanf(&qu

分支-14. 简单计算器(10)

1 #include<iostream> 2 using namespace std; 3 int main(){ 4 int a,b; 5 char s; 6 while(cin>>a){ 7 cin>>s>>b; 8 if(s=='+') 9 cout<<a+b<<endl; 10 else if(s=='-') 11 cout<<a-b<<endl; 12 else if(s=='*') 13 cout&

分支-07. 比较大小(10)

#include<iostream>using namespace std;int main(){    int a,b,c;    cin>>a>>b>>c;    if(a<=b&&a<=c)        if(b<=c)            cout<<a<<"->"<<b<<"->"<<c<<

数学之路-python计算实战(10)-机器视觉-透视投影

透视投影 三维计算机图形学中另外一种重要的变换是透视投影.与平行投影沿着平行线将物体投影到图像平面上不同,透视投影按照从投影中心这一点发出的直线将物体投影到图像平面.这就意味着距离投影中心越远投影越小,距离越近投影越大. 最简单的透视投影将投影中心作为坐标原点,z = 1 作为图像平面,这样投影变换为 ; ,用齐次坐标表示为: (这个乘法的计算结果是  = .) 在进行乘法计算之后,通常齐次元素 wc 并不为 1,所以为了映射回真实平面需要进行齐次除法,即每个元素都除以 wc: 更加复杂的透视投

分支-11. 计算工资(15)

1 /* 2 *c语言实现 3 *B11-分支-11. 计算工资(15) 4 *Created on: 2014年6月3日 5 *Author: Boomkeeper 6 *未全部通过 7 * 8 */ 9 10 #include <stdio.h> 11 #include <stdlib.h> 12 13 float salary=0; 14 15 void newStaff(int *worktime) 16 { 17 if(*worktime<=40) 18 { 19

*分支-13. 计算天数

1 /* 2 * Main.c 3 * B13-分支-13. 计算天数 4 * Created on: 2014年6月12日 5 * Author: Boomkeeper 6 * 7 ******测试又是木有完全通过啊********* 8 */ 9 10 #include <stdio.h> 11 #include <stdlib.h> 12 13 #define JANUARY 31 14 #define FEBRUARY 28 15 #define MARCH 31 16 #

*分支-11. 计算工资

1 /* 2 *Main.c 3 *B11-分支-11. 计算工资(15) 4 *Created on: 2014年6月3日 5 *Author: Boomkeeper 6 * 7 ******测试未通过********* 8 */ 9 10 #include <stdio.h> 11 #include <stdlib.h> 12 13 float salary=0; 14 15 void newStaff(int *worktime) 16 { 17 //printf("

*分支-12. 计算火车运行时间

1 /* 2 * Main.c 3 * B12-分支-12. 计算火车运行时间 4 * Created on: 2014年6月4日 5 * Author: Boomkeeper 6 * 7 ********测试未通过******* 8 */ 9 #include <stdio.h> 10 #include <stdlib.h> 11 12 int startTime,arrTime; 13 int *p_startTime=&startTime; 14 int *p_arr