ОШИБКА: cout c ++ необъявленный

0

Я изучаю c++, следуя примеру стрелок "Enter" необъявленной (сначала используйте эту функцию) ". Я читал некоторые вопросы на этом сайте, и, похоже, он не связан с объявлением функций. Но я не могу заставить его работать. Любая помощь будет оценена.

//
// 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;
}
Теги:
cout

2 ответа

2
Лучший ответ

+ Изменить

cout << "Enter the temperature in Celsius:";

в

cout << "Enter the temperature in Celsius:";

"" и "" разные.

  • 0
    Спасибо, это сработало.
  • 0
    @sms: Добро пожаловать :)
3

Используйте простой текстовый редактор или IDE. Ваши кавычки неверны.

cout << "Enter the temperature in Celsius:";

следует изменить на

cout << "Enter the temperature in Celsius:";

Ошибка вызывается из-за того, что кавычки должны быть как " не "

  • 0
    Спасибо за совет, я использую dev c ++ IDE.

Ещё вопросы

Сообщество Overcoder
Наверх
Меню