所以花了我一段时间才能找到带有编译器的代码块,但最终我发现了一个...我写了一个非常简单的代码(学习)
//
// Conversion - Program to convert temperature from Celsius degrees to
Fahrenheit : 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
cout << "Press Enter to continue..." << endl;
cin.ignore(10, '/n');
cin.get();
return 0;
}
但我不断收到此错误
--------------构建:转换时调试(编译器:GNU GCC编译器)---------------
x86_64-w64-mingw32-g ++。exe -o bin \ Debug \ Conversion.exe obj \ Debug \ main.o
在'C:\ CPP_Programs_from_Book \ Conversion'中执行'x86_64-w64-mingw32-g ++。exe -o bin \ Debug \ Conversion.exe obj \ Debug \ main.o'失败。
将无法构建
ps im使用code :: blocks PLZ我该如何解决
答案 0 :(得分:2)
似乎没有评论。
//
// Conversion - Program to convert temperature from Celsius degrees to
Fahrenheit : Fahrenheit = Celsius * (212 - 32)/100 + 32
//
应该是
//
// Conversion - Program to convert temperature from Celsius degrees to
// Fahrenheit : Fahrenheit = Celsius * (212 - 32)/100 + 32
//