我有以下的Visual C++代碼使用數學::圓形
#include <iostream>
#include <string>
#include <sstream>
#include <math.h>
using namespace std;
int Main()
{
double investment = 0.0;
double newAmount = 0.0;
double interest = 0.0;
double totalSavings = 0.0;
int month = 1;
double interestRate = 0.065;
cout << "Month\tInvestment\tNew Amount\tInterest\tTotal Savings";
while (month < 10)
{
investment = investment + 50.0;
if ((month % 3 == 0))
{
interest = Math::Round((investment * Math::Round(interestRate/4, 2)), 2);
}
else
{
interest = 0;
}
newAmount = investment + interest;
totalSavings = newAmount;
cout << month << "\t" << investment << "\t\t" << newAmount << "\t\t" << interest << "\t\t" << totalSavings;
month++;
}
string mystr = 0;
getline (cin,mystr);
return 0;
}
但它給我使用數學::圓形的問題,我實在不知道該如何使用Visual C++
我認爲他試圖使用這個:http:// m sdn.microsoft.com/en-us/library/75ks3aby。aspx – 2009-11-16 20:24:39
我如何整理然後 – roncansan 2009-11-16 20:24:42