回顾历史(二位字符串记录)

链接
在这里插入图片描述
分析:首先想到的就是map开string记录,才发现也记录不了带空格的,rnm!然后就着急┭┮﹏┭┮,我是fw,其实开二位字符串暴力即可

#include<stdio.h>
#include<string.h>
char s[100];
int n;
char a[12][100]= {"Little Gyro and Sort",
                  "Little Gyro and Sets",
                  "Little Gyro and Numbers",
                  "Little Gyro and Array",
                  "Little Gyro and Derrick",
                  "Little Gyro and Sequences",
                  "Disk Scheduling", "Monster Fighting",
                  "Logs Stacking", "Planet Connecting",
                  "Shuttle Bus", "Story of Eden"
                 };
char b[15][100]= {"Arithmetic Problems", "Birthday Gift",
                  "Pinch Pinch Pinch",
                  "Stay up Late and Wake up Early",
                  "No Breakfast for College Students",
                  "Robotics Innovation Lab",
                  "Mathematical Modelling Class",
                  "Words Interesting",
                  "Words Fascinating",
                  "Mobius Ring", "Grid Painting",
                  "Yet Another Bracket Sequence",
                  "Yet Another Stones Game",
                  "Yet Another Honoi Problem",
                  "Yet Another Infectious Virus"
                 };
char c[12][100]= {"Yin Mou", "Da Mo",
                  "Shu San", "Zu Zhuang",
                  "Xue Zhan", "Ying Jiu",
                  "Lian Meng", "Zhen Cha",
                  "Fan Gong", "Qi Cheng",
                  "Wei Xiu", "Jue Dou"
                 };
char d[14][100]= {"A Party for You Started",
                  "Broken Pad", "Cook Steak",
                  "Dessert Time", "Eat Grapes",
                  "Flag Scramble Competition",
                  "Goddess", "Happy Time is Always Short",
                  "Isolated Pointset", "Jiufeng's Football Team",
                  "Known-Well Palindrome Date - Easy Version",
                  "Known-Well Palindrome Date - Hard Version",
                  "Link Game of Prime Factors",
                  "Magic Cube Battle"
                 };
int main()
{
    scanf("%d",&n);
    getchar();
    for(int i=0;i<n;i++)
    {
        memset(s,0,sizeof(s));
        gets(s);
        int f=0;
        for(int j=0;j<12;j++)
        {
            if(strcmp(s,a[j])==0)
            {
                printf("2\n");
                f=1;
                break;
            }
        }
        if(!f)
            for(int j=0;j<15;j++)
            {
                if(strcmp(s,b[j])==0)
                {
                    printf("3\n");
                    f=1;
                    break;
                }
            }
        if(!f)
            for(int j=0;j<12;j++)
            {
                if(strcmp(s,c[j])==0)
                {
                    printf("4\n");
                    f=1;
                    break;
                }
            }
        if(!f)
            for(int j=0;j<14;j++)
            {
                if(strcmp(s,d[j])==0)
                {
                    printf("17\n");
                    f=1;
                    break;
                }
            }
        if(!f)
            printf("-1\n");
    }
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值