题意:出现Apple、iPod、iPhone、iPad时输出MAI MAI MAI!,出现Sony,输出SONY DAFA IS GOOD!
Sample Input
Apple bananaiPad lemon ApplepiSony
233
Tim cook is doubi from Apple
iPhoneipad
iPhone30 is so biiiiiiig Microsoft
makes good App.
Sample Output
MAI MAI MAI!
MAI MAI MAI!
MAI MAI MAI!
SONY DAFA IS GOOD!
MAI MAI MAI!
MAI MAI MAI!
MAI MAI MAI!
# include <iostream>
# include <cstdio>
# include <cstring>
# include <string>
# include <algorithm>
# include <cmath>
# include <queue>
# define LL long long
using namespace std ; int main ()
{
//freopen("in.txt","r",stdin) ;
string s ;
while(cin>>s)
{
int len = s.size() ;
int i ;
for (i = ; i < len ; i++)
{
string a = s.substr(i,) ;
if (a == "iPad" ||a == "iPod")
cout<<"MAI MAI MAI!"<<endl ;
else if (a == "Sony")
cout<<"SONY DAFA IS GOOD!"<<endl ;
string b = s.substr(i, );
if (b == "Apple")
cout<<"MAI MAI MAI!"<<endl ;
string c = s.substr(i, );
if (c == "iPhone")
cout<<"MAI MAI MAI!"<<endl ; }
} return ;
}