VC6.0C++编写程序,编写完后,编译没错,但是一连接时就报错,是哪里出问题了?
#include<iostream>usingnamespacestd;intmian(){intnum1,num2,max;cout<<"Typeintwonumber...
#include<iostream>
using namespace std;
int mian()
{
int num1,num2,max;
cout<<"Type in two numbers.Press Enter after each number."<<endl;
cin>>num1>>num2;
if(num1>num2)
max=num1;
cout<<"The max is"<<max<<endl;
if(num1<num2)
max=num2;
cout<<"The max is"<<max<<endl;
return 0;
}
例如这个程序,编译没错,但是一连接就出错。 展开
using namespace std;
int mian()
{
int num1,num2,max;
cout<<"Type in two numbers.Press Enter after each number."<<endl;
cin>>num1>>num2;
if(num1>num2)
max=num1;
cout<<"The max is"<<max<<endl;
if(num1<num2)
max=num2;
cout<<"The max is"<<max<<endl;
return 0;
}
例如这个程序,编译没错,但是一连接就出错。 展开
1个回答
2014-05-23
展开全部
int num1, num2, max;
cout << "Type in two numbers.Press Enter after each number." << endl;
cin >> num1 >> num2;
if (num1 > num2){
max = num1;
cout << "The max is:" << max << endl;
}
if (num1 < num2){
max = num2;
cout << "The max is:" << max << endl;
}
cout << "Type in two numbers.Press Enter after each number." << endl;
cin >> num1 >> num2;
if (num1 > num2){
max = num1;
cout << "The max is:" << max << endl;
}
if (num1 < num2){
max = num2;
cout << "The max is:" << max << endl;
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询