我编了如下程序,可发现运行错误,又不知道是怎么回事

来源:百度知道 编辑:UC知道 时间:2024/05/16 20:27:13
// 25.cpp : 定义控制台应用程序的入口点。
//

#include "stdafx.h"

int _tmain(int argc, _TCHAR* argv[])
{
return 0;
}

#include <iostream.h>
void main ()
{
int x,y,z,max;
cout << "输入x y z:";
cin >> x >> y >> z;
if (x>y) max=x;
else max=y;
if (max<z) max=z;
cout << "max=" << max << endl;
}

1>------ 已启动生成: 项目: 25, 配置: Debug Win32 ------
1>正在编译...
1>25.cpp
1>c:\documents and settings\administrator\my documents\visual studio 2005\projects\25\25\25.cpp(12) : fatal error C1083: 无法打开包括文件:“iostream.h”: No such file or directory
1>生成日志保存在“file://c:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\25\25\Debug\BuildLog.htm”
1>25 - 1 个错误,个警告
========== 生成: 0 已成功, 1 已失败,

#include <stdafx.h>

int tmain(int argc, TCHAR* argv[])
{
return 0;
}

#include <iostream.h>
void main ()
{
int x,y,z,max;
printf( "输入x y z:")
cin > x > y > z;
if (x>y) max=x;
else max=y;
if (max<z) max=z;
printf ( "max=\n" ,max );
}