zoukankan      html  css  js  c++  java
  • 【模拟】HDU 5774 Where Amazing Happens

    题目链接:

      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
    ",&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
    ",ans);
    87     }    
    88     return 0;
    89 }
    View Code
  • 相关阅读:
    贪心算法
    分治法
    递归法
    查找二 树与图的搜索
    (转载)查找三 哈希表的查找
    (转载)查找一 线性表的查找
    4.写出完整版的strcpy函数
    3.strcpy使用注意(3)
    2.strcpy使用注意(2)
    1.strcpy使用注意
  • 原文地址:https://www.cnblogs.com/Coolxxx/p/5769525.html
Copyright © 2011-2022 走看看