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

交稅編程

發布時間: 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-03-16 10:33:27 瀏覽:795
游戲目錄在哪裡安卓 發布:2025-03-16 10:33:19 瀏覽:467
婉兒腳本 發布:2025-03-16 10:19:33 瀏覽:580
c語言ftp下載文件 發布:2025-03-16 10:05:02 瀏覽:307
手機帳戶密碼怎麼找回密碼 發布:2025-03-16 10:02:10 瀏覽:706
c語言位段的使用 發布:2025-03-16 10:00:38 瀏覽:572
象山編程 發布:2025-03-16 09:38:41 瀏覽:927
綠點掌知識薪資密碼是多少 發布:2025-03-16 09:37:05 瀏覽:597
osu安卓版怎麼 發布:2025-03-16 09:37:05 瀏覽:153
python編程編程第三版 發布:2025-03-16 09:29:56 瀏覽:968