我正在學習C++,下面的示例trows「`輸入'未聲明(首次使用此函數)」。 我一直在閱讀本網站的一些問題,它似乎與不聲明函數有關。但我無法讓它工作。任何幫助將不勝感激。錯誤:cout C++ undeclared
//
// Program to convert temperature from Celsius degree
// units into Fahrenheit degree units:
// Fahrenheit = Celsius * (212 - 32)/100 + 32
//
#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int nNumberofArgs, char* pszArgs[])
{
// enter the temperature in Celsius
int celsius;
cout << 「Enter the temperature in Celsius:」;
cin >> celsius;
// calculate conversion factor for Celsius
// to Fahrenheit
int factor;
factor = 212 - 32;
// use conversion factor to convert Celsius
// into Fahrenheit values
int fahrenheit;
fahrenheit = factor * celsius/100 + 32;
// output the results (followed by a NewLine)
cout << 「Fahrenheit value is:」;
cout << fahrenheit << endl;
// wait until user is ready before terminating program
// to allow the user to see the program results
system(「PAUSE」);
return 0;
}
你是在Microsoft Word上輸入的嗎? – 0x499602D2
不,在DEV C++ IDE中,實際上我沒有輸入它。我從C++ For Dummy第5版中複製了這個例子。 – sms