uvalive5989(水题)
生活随笔
收集整理的這篇文章主要介紹了
uvalive5989(水题)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
題意:
給出一串字符串,‘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; }總結
以上是生活随笔為你收集整理的uvalive5989(水题)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: uvalive5986(贪心)
- 下一篇: uvalive5990(坑点蛮多的一道题