vs2010中写c++程序
在vs2010中写c++程序,编译错误提示“无法解析的外部符号”,如何解决该问题呢?求解,谢谢!代码如下:#include<iostream>
using namespace std;
extern int max(int,int);
void main()
{
int x,y,z,m;
cout<<"输入x y z:";
cin>>x>>y>>z;
m=max(x,y);
m=max(m,z);
if(m<z) m=z;
cout<<"max="<<m<<endl;
}
[解决办法]
- C/C++ code
#include<iostream>using namespace std;int main(){ int x,y,z,m; cout<<"输入x y z:"; cin>>x>>y>>z; m=max(max(x,y),z); cout<<"max="<<m<<endl; return 0;}
[解决办法]
- C/C++ code
#include<iostream>#include <algorithm> //包含了std::maxusing namespace std;//extern int max(int,int);void main(){int x,y,z,m;cout<<"输入x y z:";cin>>x>>y>>z;m=max(x,y);m=max(m,z);if(m<z) m=z;cout<<"max="<<m<<endl;}