小编程问题

来源:百度知道 编辑:UC知道 时间:2024/06/18 15:06:46
#include <iostream>
using namespace std;
int main()
{
int a,b,c,max;
cout<<"第一个数:";
cin>>a;
cout<<"第二个数:";
cin>>b;
cout<<"第三个数:";
cin>>c;
if(a>b)
max=a;
else
max=b;
if(c>max)
max=c;
cout<<"最大的数是: "<<max<<endl;
return 0;
}
-----------------------------------------------
Deleting intermediate files and output files for project '2 - Win32 Debug'.
--------------------Configuration: 2 - Win32 Debug--------------------
Compiling...
StdAfx.cpp
Compiling...
2.cpp
c:\documents and settings\administrator\桌面\新建文件夹\2\2.cpp(21) : fatal error C1010: unexpected end of file while looking for precompiled header directive
执行 cl.exe 时出错.

2.exe - 1 error(s), 0 warning(s)
----------------------------

我试了下程序,在我电脑上可以运行。
你检查以下看是不是你装的C++出问题了,可以拿到其他电脑上去试以下。程序本身是没有问题的。

CPP相关的环境变量没设置。(具体的说,就是iostream.h找不到)
用VS编译吧。。