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
");
        else printf("lose
");
    }
}
原文地址:https://www.cnblogs.com/zufezzt/p/5249324.html