题意:
给出一串字符串,‘D’代表龙,‘.’代表空地,如果有龙我们就要输出“You shall not pass!”,否则输出“Possible”。
思路:
不多说。。。
代码:
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<queue>
#include<cstdlib>
#include<cmath>
using namespace std;
char s[1000000];
int main()
{
int n;
while(scanf("%d",&n)!=EOF)
{
for(int i=1;i<=n;i++)
{scanf("%s",s);
int flag=0;
for(int i=0;i<strlen(s);i++)
if(s[i]=='D')
{
flag=1;
break;
}
if(flag)
puts("You shall not pass!");
else
puts("Possible");
}
}
return 0;
}