posts - 17,  comments - 0,  trackbacks - 0
http://acm.cugb.edu.cn/JudgeOnline/showproblem?problem_id=1025
我的代码: 
 1 #include <cstdlib>
 2
 #include <string.h>
 3 #include <iostream>
 4 
 5 using namespace std;
 6 
 7 char tname[20],name[20],sno[20],sno1[20],sex[20];
 8 int main()
 9 {
10     
11     int i, sn, cur_team_sex_num, female_team_num=0,team_num=0;
12     
13     while(scanf("%s",tname), strcmp(tname,"END")!=0)
14     {
15        
16        team_num++;
17        cur_team_sex_num=0;
18        scanf("%d",&sn);    
19        for(i=0;i<sn;i++)
20        {
21            scanf("%s%d%d%s", name, sno, sno1, sex);
22            if(sex[0== 'F')
23                   cur_team_sex_num++;
24        }
25        
26            if((cur_team_sex_num == sn)|| (cur_team_sex_num >=2) )//
27            {
28                 female_team_num++;                
29                 cout<<tname<<"[F]"<<endl;
30            }
31            else
32            {
33               cout<<tname<<endl;
34            }
35 
36     }    
37     cout<<team_num<<" "<<female_team_num<<endl;  
38     system("PAUSE");
39     return 0;
40 }
41  
posted on 2011-10-29 03:05 刘聪 阅读(125) 评论(0)  编辑 收藏 引用

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理



<2011年10月>
2526272829301
2345678
9101112131415
16171819202122
23242526272829
303112345

常用链接

留言簿(4)

随笔档案

搜索

  •  

最新评论

阅读排行榜

评论排行榜