标题: 温度测试程序有问题请教! [打印本页] 作者: Forever紫月 时间: 2009-11-4 02:24 标题: 温度测试程序有问题请教! // temperature conversion application
#include <iostream.h>
void main()
{
// input temperature, numeric input
int tempinput;
// output temperature, numeric output
int tempoutput;
// input conversion type, single character
// "C" will be used to represent C to F.
// "F" will be used to represent F to C.
char conversiontype;
// input the temperature
cin >> tempinput;
// input conversion type
cin >> conversion type;
// conditionals below
if (conversiontype == 67)
// calculation code here for C to F
tempoutput = (1.8 * tempinput) + 32;
if (conversiontype == 70)
// calculation code here for F to C
tempoutput = (tempinput - 32) * 0.555;
cout << tempout << endl;
}
vc++ 6.0上输出有错
1 error(s), 0 warning(s)
但是我检查了多次不知道错在哪!?
请多指教作者: 〖艾〓木〗 时间: 2009-11-4 02:24
cin >> conversion type;
cin >> conversiontype;作者: 轻松由我 时间: 2009-11-4 02:24
#include<iostream.h>
void main()
{