文章
34
粉丝
329
获赞
1
访问
282.4k
#include <iostream>
using namespace std;
class compare
{protected:
int b[100];
public:
void afferent(int a[],int n)
{int i;
for(i=0;i<n;i++)
b[i]=a[i];
}
};
class imin:public compare
{
public:
int jmin(int n)
{
int i,mm=b[0];
for(i=0;i<n;i++)
if(mm>b[i])mm=b[i];
cout<<mm<<" ";
return mm;
}
};
class imax:public compare
{
public:
int jmax(int n)
{
int i,m=b[0];
for(i=0;i<n;i++)
if(m<b[i])m=b[i];
cout<<m<<" ";
return m;
&nb...
登录后发布评论
暂无评论,来抢沙发