修改了两个地方,代码如下:
#包含
int main()
{双重税,税率;
intalary,d;
printf(“输入您的月薪”);
scanf(“%d”和薪水); // int类型为%d,后跟地址获取
如果(薪水<= 3500)
{
费率= 0;
d = 0; //将此if语句更改为此,如果未分配d,程序将崩溃
}
elseif(薪水<= 5000)
{rate = 0.03;
d = 105;
elseif(工资<= 8000)
{rate = 0.1;
d = 555;
{rate = 0.2;
d = 1005;
{rate = 0.25;
d = 2755;
{rate = 0.3;
{费率= 0.35;
d = 5505;
}其他
{比率= 0.45;
税=税率*(salary-3500)-d;
printf(“您应支付的个人所得税为lf元\ n%,税);
return0;
#include“” stdio.h“
intmain(无效){
双打,rs,老鼠;
Printf(“请输入您的电话号码... \ ns =“);
Scanf(“%lf”,&s);
如果(rs = s-2000,rs <500)
大鼠= 0.05;
否则(rs> = 500 && rs <2000)
大鼠= 0.1;
Elseif(rs> = 2000 && rs <5000)
大鼠= 0.15;
大鼠= 0.2;
大鼠= 0.25;
大鼠= 0.3;
大鼠= 0.35;
大鼠= 0.4;
大鼠= 0.45;
Printf(“ YOURSGS:%。2f \ tTAX:%。2f \ tAGS:%。2f \ n”,s,rat * rs,s-rat * rs);
返回0;
你能放吗
#include
主()
float x,num [9] = {0};
char i ="n";
x = 0;
做
scanf(“%f”,&x);
如果(x <= 500)
数值[0] = x-x * 0.05;
printf(“应得薪水为%.2f”,数字[0]);
否则,如果(x <= 2000)
num [1] = x-(num [0] +(x-500)* 0.1);
printf(“应得的薪水为%.2f”,编号[1]);
否则,如果(x <= 5000)
num [2] = x-(num [1] +(x-2000)* 0.15);
printf(“应得的薪水为%.2f”,编号[2]);
num [3] = x-(num [2] +(x-5000)* 0.2);
printf(“应得薪水为%.2f”,编号[3]);
printf(“应得的薪水为%.2f”,编号[4]);
printf(“应得的工资是%.2f”,数字[5]);
printf(“应得的薪水为%.2f”,编号[6]);
printf(“应得的薪水为%.2f”,编号[7]);
printf(“应得的薪水为%.2f”,编号[8]);
printf(“选择是否继续执行:y或n \ n”);
scanf(“%c”,&i);
} while(((i =="y")||(i =="Y")));
给我发邮件