有人能幫我解決這個問題嗎? 我已經把我的頭腦花了一個多小時,我無法讓它工作。 這是C++
,我一直在學習一點點,但我還是新...我無法編寫控制檯應用程序來創建一個簡單的程序來解決養老金的數學公式
int main()
{
double rate, amount,time, S;
cout << "Insert the time of the super: ";
cin >> time;
cout << "Insert the rate (as a decimal, eg 1% AKA 101% = 1.01): ";
cin >> rate;
cout << "Insert the amount $: ";
cin >> amount;
S =("amount * (rate^time - 1)", pow(rate,time));
cin >> S;
cout << "The total amount is: " << "S /(rate - 1)" << endl;
system("PAUSE");
return 0;
}
我沒有得到一個編譯錯誤,但我永遠不能從它
我認爲-1應該被分組爲pow(rate,time-1)而不是pow(rate,time)-1。我可能會錯誤的這個,但是。 – templatetypedef
@模板是啊我認爲你是對的,它看起來就是這樣,mea culpa。 –