【HDOJ】5007 Post Robot
【题目】 http://acm.hdu.edu.cn/showproblem.php?pid=5007
【报告】
闲来无事刷水题……
直接暴力判断是否相同就行了,连KMP都不用。简单粗暴。
【程序】
#include
#include
#include
#include
#include
using namespace std;
const int Len = 10000;
char str[Len];
inline bool check(char a[],char b[])
{
if
(strlen(a)
for
(;*b;a++,b++)
if (*a!=*b) return false;
return
true;
}
int main()
{
while
(scanf("%s",str)!=EOF)
{
// cout << str << endl;
for (int i=0;i
if
(check(str+i,"Apple")||check(str+i,"iPhone")||check(str+i,"iPod")||check(str+i,"iPad"))
printf("MAI MAI MAI!\n");
else if (check(str+i,"Sony"))
printf("SONY DAFA IS GOOD!\n");
}
return
0;
}
为什么来到这,行将终结、匆忙纷扰、并且完全看不到救赎的世界。