首页 > 代码库 > XDOJ_1141_水

XDOJ_1141_水

http://acm.xidian.edu.cn/problem.php?id=1141

 

水过。

 

#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;

long long x,y,a;

int main()
{
    while(~scanf("%ld %ld %ld",&x,&y,&a))
    {
        a %= x+y;
        if(a == 0)
        {
            printf("light\n");
            continue;
        }
        while(a)
        {
            a -= x;
            if(a <= 0)
            {
                printf("wanshen\n");
                break;
            }
            a -= y;
            if(a <= 0)
            {
                printf("light\n");
                break;
            }
        }
    }
    return 0;
}

 

XDOJ_1141_水