我需要幫助儘管我通過ideone傳遞代碼,它似乎工作,它是數據類型可能嗎?我需要幫助ttlTx變量顯示爲0血流沖刷的輸出。幫助讚賞!錯誤的輸出簡單的稅計算器
/*
*/
//Libraries
#include <cstdlib>
#include <iostream>
using namespace std;
//Global Constants
//Functioning Prototypes
//Execution Begins Here
int main(int argc, char **argv){
//Variables
float purchse, ttlTx, stateTx, cntyTx, total;
//Process
purchse= 52;
stateTx= 0.04; //state tax
cntyTx= 0.02; //county tax
ttlTx= purchse*(stateTx + cntyTx); //total tax
total = purchse+ttlTx;
//output
cout<<"the total tax on a $"<< purchse<<" is $"<<
ttlTx<<endl;
cout<<"which brings the total to $" << total<<endl;
//Exit Stage Right
system("PAUSE");
return EXIT_SUCCESS;
}
流血?那是什麼? – bmargulies
Bloodshed Dev-C++,IDE - 請參閱http://www.bloodshed.net/devcpp.html。 – paxdiablo
對不起,我的意思是DEV-C++,Bloodshed是軟件的名稱 – noobUser