POJ 3458 Colour Sequence

水题。

#include<cstdio>
#include<cstring>
#include<cmath>

const int maxn = 100 + 10;
char s[maxn], v[maxn], h[maxn];

int main()
{
    int T;
    scanf("%d", &T);
    while (T--)
    {
        scanf("%s", s);
        scanf("%s", v);
        scanf("%s", h);
        int len1 = strlen(s);
        int len2 = strlen(v);

        int tot = 0;
        for (int j = 0; j<len2&&tot<len1; j++)
        if (s[tot] == v[j] || s[tot] == h[j] || v[j] == '*' || h[j] == '*')
            tot++;

        if (tot == len1) printf("win\n");
        else printf("lose\n");
    }
}

 

posted @ 2016-03-07 08:24  Fighting_Heart  阅读(186)  评论(0编辑  收藏  举报