主题:[原创]一个简单的温度转换程序,供大家参考。
一个简单的温度转换程序(用Dev-C++ 5写的),供大家参考。
#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int nNumberofArgs, char* pszArgs[])
{
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;
system("PAUSE");
return 0;
}
#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int nNumberofArgs, char* pszArgs[])
{
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;
system("PAUSE");
return 0;
}