首页 > 其他 > 详细

POJ 3458 Colour Sequence

时间:2016-03-07 08:55:51      阅读:148      评论:0      收藏:0      [点我收藏+]

水题。

#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");
    }
}

 

POJ 3458 Colour Sequence

原文:http://www.cnblogs.com/zufezzt/p/5249324.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!