我正在学习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