Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
请问哪里有问题??是理解错了??帮忙看下!谢谢!!#include<iostream> using namespace std; int girl[201],boy[201]; int main() { int g,b,m,x,y,i,p=1,mm,nn; while(1){ cin>>g>>b>>m; if(g==0 && b==0 && m==0) break; memset(girl,0,sizeof(girl)); memset(boy,0,sizeof(boy)); for(i=1;i<=m;i++){ cin>>x>>y; girl[x]++; boy[y]++; } mm=b;nn=g; for(i=1;i<=g;i++) if(girl[i]==b) mm++; for(i=1;i<=b;i++) if(boy[i]==g) nn++; if(mm>=nn) cout<<"Case "<<p++<<": "<<mm<<endl; else cout<<"Case "<<p++<<": "<<nn<<endl; } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator