bukrat
@bukrat
Лансер

Почему не запускается программа в Dev-C++?

// 
//  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; 
}


Запускаю программу в Dev-C++ v. 5.7.1, компилятор MinGW GCC4.8.1, 32-bit Release говорит, что
File not compiled
.
Только начинаю программировать. Помогите не понимаю :)
  • Вопрос задан
  • 4259 просмотров
Пригласить эксперта
Ответы на вопрос 2
AnnTHony
@AnnTHony
Интроверт
int fahrenheit;
fahrenheit = factor * celsius/100 + 32;

Градусы по Фаренгейту заданы целочисленным типом. Попробуйте заменить на double.
При делении явно дробные числа получаются.

upd.
#include <iostream>

using namespace std;

int main()
{
    int celsius;
    cout << "Enter the temperature in Celsius:";
    cin >> celsius;
    int factor;
    factor = 212 - 32;
    int fahrenheit;
    fahrenheit = factor * celsius/100 + 32;
    cout << "Fahrenheit value is:";
    cout << fahrenheit << endl;
    return 0;
}


ed1f2f9be18845ed9bc84423365109ed.jpg

Компилятор GNU GCC, IDE Code::Block
Ответ написан
AxisPod
@AxisPod
Процесс компиляции идет? Есть чувство, что ничерта не компилируется, раз уж под виндой сидите попробуйте Visual Studio C++ Express для начала. А потом ковыряйте Dev-C++ и настраивайте правильно.
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы