當前位置:首頁 » 編程軟體 » 交稅編程

交稅編程

發布時間: 2023-08-21 03:35:22

c語言:編寫程序,輸入月薪數a,計算並輸出稅率、應繳稅款和實得獎金數。

#include <stdio.h>
void main()
{
double a, rate;
int c,tax,profit;
printf("輸入獎金數:");
scanf("%lf",&a);
if(a>=5000)c=10;
else c=a/500;
switch(c) {
case 0: rate=0; break;
case 1: rate=0.05; break;
case 2:
case 3:
case 4: rate=0.08; break;
case 5:
case 6:
case 7:
case 8:
case 9: rate=0.10; break;
case 10: rate=0.15; break;
}
printf("%d",c);
tax=(a*rate);
profit=(int)(a-tax);
printf("稅率為%lf,應繳稅款為%d,實得獎金數為%d\n",rate,tax,profit);
}

② 怎麼用JAVA編程計算工資個人所得稅

你一開始就 int KGongZ = GongZ-3500; 那我問你工資如果小於3500.不交稅,最後反而要補貼了。。。邏輯有錯誤

③ C語言編程題,求助大佬,謝謝!

#include "stdio.h"

int main(int argc,char *argv[]){

double w,tax;

printf("Please enter the amount of wages before taxes... w=");

if(scanf("%lf",&w)!=1 || w<0){

printf("Input error, exit... ");

return 0;

}

if((w-=3500)<=1500.0)

tax=w*0.03;

else if(w>1500.0 && w<=4500.0)

tax=w*0.1-105;

else if(w>4500.0 && w<=9000.0)

tax=w*0.20-555;

else if(w>9000.0 && w<=35000.0)

tax=w*0.25-1005;

else if(w>35000.0 && w<=55000.0)

tax=w*0.3-2766;

else if(w>55000.0 && w<=80000.0)

tax=w*0.35-5505;

else if(w>80000.0)

tax=w*0.45-13505;

printf(" %.2f ",tax);

return 0;

}

代碼圖片和運行樣例:

熱點內容
戰地一有什麼不用加速器的伺服器 發布:2025-07-10 08:51:33 瀏覽:404
linux怎麼看自己伺服器的ip 發布:2025-07-10 08:51:29 瀏覽:135
怎麼寫腳本刷視頻 發布:2025-07-10 08:49:51 瀏覽:381
安卓微信在哪裡設置鈴聲 發布:2025-07-10 08:48:05 瀏覽:232
dropbear編譯 發布:2025-07-10 08:27:35 瀏覽:684
我的世界電腦建造伺服器推薦 發布:2025-07-10 08:13:08 瀏覽:401
如何提高存儲數據的速度 發布:2025-07-10 07:55:57 瀏覽:259
規范c語言代碼 發布:2025-07-10 07:55:57 瀏覽:516
在線砍價源碼 發布:2025-07-10 07:55:56 瀏覽:796
編程工作年限 發布:2025-07-10 07:44:42 瀏覽:143