码迷,mamicode.com
首页 > 移动开发 > 详细

【模拟】HDU 5774 Where Amazing Happens

时间:2016-08-14 10:10:19      阅读:155      评论:0      收藏:0      [点我收藏+]

标签:

题目链接:

  http://acm.hdu.edu.cn/showproblem.php?pid=5774

题目大意

  已知1946~2015每一年赢得人是谁,给n个名字,问赢了多少次。

题目思路:

  【模拟】

  打个表就好。

 

技术分享
 1 #include<stdio.h>
 2 #include<string.h>
 3 char list[100][35]=
 4 {"Cleveland Cavaliers",
 5 "Golden State Warriors",
 6 "San Antonio Spurs",
 7 "Miami Heat",
 8 "Miami Heat",
 9 "Dallas Mavericks",
10 "L.A. Lakers",
11 "L.A. Lakers",
12 "Boston Celtics",
13 "San Antonio Spurs",
14 "Miami Heat",
15 "San Antonio Spurs",
16 "Detroit Pistons",
17 "San Antonio Spurs",
18 "L.A. Lakers",
19 "L.A. Lakers",
20 "L.A. Lakers",
21 "San Antonio Spurs",
22 "Chicago Bulls",
23 "Chicago Bulls",
24 "Chicago Bulls",
25 "Houston Rockets",
26 "Houston Rockets",
27 "Chicago Bulls",
28 "Chicago Bulls",
29 "Chicago Bulls",
30 "Detroit Pistons",
31 "Detroit Pistons",
32 "L.A. Lakers",
33 "L.A. Lakers",
34 "Boston Celtics",
35 "L.A. Lakers",
36 "Boston Celtics",
37 "Philadelphia 76ers",
38 "L.A. Lakers",
39 "Boston Celtics",
40 "L.A. Lakers",
41 "Seattle Sonics",
42 "Washington Bullets",
43 "Portland Trail Blazers",
44 "Boston Celtics",
45 "Golden State Warriors",
46 "Boston Celtics",
47 "New York Knicks",
48 "L.A. Lakers",
49 "Milwaukee Bucks",
50 "New York Knicks",
51 "Boston Celtics",
52 "Boston Celtics",
53 "Philadelphia 76ers",
54 "Boston Celtics",
55 "Boston Celtics",
56 "Boston Celtics",
57 "Boston Celtics",
58 "Boston Celtics",
59 "Boston Celtics",
60 "Boston Celtics",
61 "Boston Celtics",
62 "St. Louis Hawks",
63 "Boston Celtics",
64 "Philadelphia Warriors",
65 "Syracuse Nats",
66 "Minneapolis Lakers",
67 "Minneapolis Lakers",
68 "Minneapolis Lakers",
69 "Rochester Royals",
70 "Minneapolis Lakers",
71 "Minneapolis Lakers",
72 "Baltimore Bullets",
73 "Philadelphia Warriors"};
74 int main()
75 {
76     int cas,i,j,ans;
77     char temp[35];
78     scanf("%d\n",&cas);
79     for(i=1;i<=cas;i++)
80     {
81         gets(temp);
82         printf("Case #%d: ",i);
83         ans=0;
84         for(j=0;j<115-46+1;j++)
85         if (strcmp(temp,list[j])==0) ans++;
86         printf("%d\n",ans);
87     }    
88     return 0;
89 }
View Code

 

【模拟】HDU 5774 Where Amazing Happens

标签:

原文地址:http://www.cnblogs.com/Coolxxx/p/5769525.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!