LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
头文件#ifndef Array_#define Array_
class Array{
private:
int * array;
int max;
int min;
double middle;
int lenth;
public:
Array();
~Array();
void Arr(int le);
void calcul();
void show();
};
#endif
文件1
#include<iostream>
#include"Array.h"
Array::Array()
{
int * array=NULL;
int max=0;
int min=0;
double middle=0.0;
int lenth=0;
}//10
Array::~Array()
{
delete array;
}
void Array::Arr (int le)
{
using namespace std;
int b;
int i;
cout<<"yi"<<endl;
array=new int [le];
for(i=0;i<le;++i)
{
cin>>b;
array[i]=b;
}
}
//23.........
void Array::calcul ()
{
int j=0,sum=0;
min=max=array[j];
for(j;j<lenth;++j)
{
if(min>array[j+1])//30
min=array[j+1];
if(max<array[j+1])
max=array[j+1];
sum+=array[j];
}
middle=(1.0*sum)/(j+1);
}
void Array::show ()
{
using namespace std;
cout<<lenth<<endl;//40
cout<<max<<endl;
cout<<min<<endl;
cout<<middle<<endl;
}
文件2
#include<iostream>
#include"Array.h"
int main()
{
using namespace std;
Array arr;
int le;
cin>>le;
cout<<"lin"<<endl;
arr.Arr (le);
cout<<"jfkghfgn"<<endl;
arr.calcul ();
arr.show ();
return 0;
}
题目要求:
从键盘输入任一组整数存入一维数组中,在屏幕上输出显示该数组元素中的最大值、最小值以及平均值。