#include<iostream.h>
#include<string>
#include<string.h>
using namespace std;
class School
{
public:
char* sname;
int num;
int totalscore;
School(char* sname,int num)
{
this->sname=sname;
this->num=num;
}
void disp()
{
cout<<sname<<"("<<num<<")"<<endl;
}
};
class ManMatch
{
char* mname;
int mno;
ManMatch(char* mname,int mno)
{
this->mname=mname;
this->mno=mno;
}
void display()
{
int m=1;
cout<<"男子竞赛项目"<<m<<endl;
cout<<mname<<endl;
cout<<"代号:"<<mno<<endl;
m++;
}
};
class WomanMatch
{
char* wname;
int wno;
WomanMatch(char* wname,int wno)
{
this->wname=wname;
this->wno=wno;
}
void display()
{
int w=1;
cout<<"女子竞赛项目"<<w<<endl;
cout<<wname<<endl;
cout<<"代号:"<<wno<<endl;
w++;
}
};
void main()
{
int N=0,M=0,W=0,i=1,j=1,k=1,a=0,b=0,c=0;
int num;
char * name=NULL;
float score=0;
cout<<"请输入:"<<endl;
cout<<"参赛学校总数 "<<"男子竞赛项目数 "<<"女子竞赛项目数 "<<endl;
cin>>N>>M>>W;
int s[]={0};
cout<<"请填写比赛结果:"<<endl;
for(i=1;i<=M;i++)
{
cout<<"男子竞赛项目"<<i<<"的比赛结果"<<endl;
for(j=1;j<=5;j++)
{
cout<<" 第"<<j<<"名:"<<endl;
cout<<"姓名 "<<"比赛成绩 "<<"所在学校代号"<<endl;
cin>>name>>score>>num;
switch(j)
{
case 1:
for(k=1;k<=N;k++)
{
if(num==s[k-1]){
s[k-1]+=7;
break;
}
}
break;
case 2:
for(k=1;k<=N;k++)
{
if(num,s[k-1]){
s[k-1]+=5;
break;
}
}
break;
case 3:
for(k=1;k<=N;k++)
{
if(num,s[k-1]){
s[k-1]+=3;
break;
}
}
break;
case 4:
for(k=1;k<=N;k++)
{
if(num,s[k-1]){
s[k-1]+=2;
break;
}
}
break;
case 5:
for(k=1;k<=N;k++)
{
if(num,s[k-1]){
s[k-1]+=1;
break;
}
}
break;
}
}
}
for(a=1;a<=M;a++)
{
cout<<"女子竞赛项目"<<a<<"的比赛结果"<<endl;
for(b=1;b<=5;b++)
{
cout<<" 第"<<b<<"名:"<<endl;
cout<<"姓名:"<<endl;cin>>name;
cout<<"比赛成绩:"<<endl;cin>>score;
cout<<"所在学校代号:"<<endl;cin>>num;
switch(b)
{
case 1:
for(c=1;c<=W;c++)
{
if(num,s[c-1]){
s[c-1]+=7;
break;
}
}
break;
case 2:
for(c=1;c<=N;c++)
{
if(num,s[c-1]){
s[c-1]+=5;
break;
}
}
break;
case 3:
for(c=1;c<=N;c++)
{
if(num,s[c-1]){
s[c-1]+=3;
break;
}
}
break;
case 4:
for(c=1;c<=N;c++)
{
if(num,s[c-1]){
s[c-1]+=2;
break;
}
}
break;
case 5:
for(c=1;c<=N;c++)
{
if(num,s[c-1]){
s[c-1]+=1;
break;
}
}
break;
}
}
}
}