#include<stdio.h>
#include<string>
#include<iostream>
#include<fstream>
using namespace std;
//定义一个球类
class
football
{
int coursenum;
char name[15];
int matchnum, losenum, winnum, equnum ;
int innum, outnum;
int credit;
public:
football(int c, char n[15], int m, int l, int w, int e, int i, int o,int cre)
{
coursenum=c;
strcpy(name,n);
matchnum=m;
losenum=l;
winnum=w;
equnum=e;
innum=i;
outnum=o;
credit=cre;
}
void setcoursenum(int coursenum)
{
this->coursenum=coursenum;
}
void setname(char name[15])
{
strcpy(this->name,name);
}
int getcoursenum()
{
return coursenum;
}
string getname()
{
return name;
}
int getcredit()
{
return credit;
}
int getlosenum()
{
return losenum;
}
int getwinnum()
{
return winnum;
}
int getequnum()
{
return equnum;
}
int getinnum()
{
return innum;
}
int getoutnum()
{
return outnum;
}
void setresault(int n1,int n2)
{
innum+=n1;
outnum+=n2;
if(n1>n2)
{
credit+=3;
winnum++;
}
else if(n1==n2)
{
credit++;
equnum++;
}
else
{
losenum++;
}
}
};
//排序函数
bool paixu(football f[],int N)
{
int i,j;
football temp;
for(i=0;i<N;i++)
{
for(j=0;j<N-1-i;j++)
if(f[j].credit<f[j+1].credit)
{
temp=f[i];
f[i]=f[i+1];
f[i+1]=temp;
}
}
}
嘿嘿,麻烦运行一下,这该怎么改呢???