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

交稅編程

發布時間: 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;

}

代碼圖片和運行樣例:

熱點內容
linux怎麼編譯c文件 發布:2025-09-18 09:55:16 瀏覽:301
python安裝後無法運行 發布:2025-09-18 09:45:57 瀏覽:236
安卓手機怎麼剪輯音樂 發布:2025-09-18 09:44:16 瀏覽:781
伺服器地址修改在哪找 發布:2025-09-18 09:42:41 瀏覽:441
sntp伺服器地址 發布:2025-09-18 09:28:36 瀏覽:552
phpunit 發布:2025-09-18 09:25:19 瀏覽:571
怎麼改伺服器的ip地址嗎 發布:2025-09-18 09:24:33 瀏覽:12
編譯703n固件 發布:2025-09-18 08:50:59 瀏覽:539
三星手機系統文件夾是哪個文件夾 發布:2025-09-18 08:48:45 瀏覽:284
rmijava 發布:2025-09-18 08:38:26 瀏覽:22