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
  • 相关阅读:
    从字符串中找到中文
    Extjs前端细节处理
    《高效能人士的7个习惯》读后摘记
    千分位设置
    Java语言程序设计 上机实验2 掌握Java的基本语言成分和流程控制语句。 掌握Java中数组的使用,理解引用数据类型。 掌握String类的使用。
    java报告(一)编程打印一个三角形的乘法口诀表
    计算机组成原理 课程设计报告
    汇编语言作业(七)
    汇编语言作业(六)
    汇编语言作业(五)
  • 原文地址:https://www.cnblogs.com/Coolxxx/p/5769525.html
Copyright © 2011-2022 走看看