100年地特四等程式語言 - 考試
By Rebecca
at 2013-03-31T14:26
at 2013-03-31T14:26
Table of Contents
想請問一個程式設計的問題
題目是說薪水40000以上要扣0.05的稅金
我用C編譯器(Turbo C v2.01)執行
不管金額輸入4萬以上或以下都只會出現"Your tax is 0."
煩請高手解惑 感謝
#include <stdio.h>
main(){
int salary;
prinitf("Please input your salary:");
scanf("%d",&salary);
if(salary>=40000)
printf("Your tax is %d.",salary*0.05);
else
printf("Your tax is 0.");
}
即使中間if那邊改成如下,結果也是一樣
if(salary>=40000){
salary*=0.05;
printf("Your tax is %d.",salary);}
else
printf("Your tax is 0.");
--
Tags:
考試
All Comments
By Valerie
at 2013-04-05T13:42
at 2013-04-05T13:42
By Iris
at 2013-04-09T23:19
at 2013-04-09T23:19
By Erin
at 2013-04-14T11:44
at 2013-04-14T11:44
By Elizabeth
at 2013-04-15T01:30
at 2013-04-15T01:30
By Emily
at 2013-04-16T01:21
at 2013-04-16T01:21
By Puput
at 2013-04-20T01:25
at 2013-04-20T01:25
By Dora
at 2013-04-22T23:49
at 2013-04-22T23:49
By Zenobia
at 2013-04-23T05:18
at 2013-04-23T05:18
By Kyle
at 2013-04-23T16:07
at 2013-04-23T16:07
Related Posts
這種職缺是什麼?
By Hedwig
at 2013-03-31T13:58
at 2013-03-31T13:58
輸配電學-標么值
By Selena
at 2013-03-31T13:57
at 2013-03-31T13:57
資料庫 ER Model問題請教
By Donna
at 2013-03-31T13:11
at 2013-03-31T13:11
請問法學諸論跟法學大意的不同?
By Carolina Franco
at 2013-03-31T12:12
at 2013-03-31T12:12
國營事業招考 最快9月底
By Rosalind
at 2013-03-31T11:00
at 2013-03-31T11:00