1929 淘气的忍者
Submit solution
Points:
100
Time limit:
1.0s
Memory limit:
32M
Problem types
Allowed languages
C, C++, Java, Python
Description
忍者(naruto)与你躲猫猫呢。你能不能找到呢……
Input
若干行字串,其长度不大于100。
Output
若字串中含”naruto”的子串,那么表示忍者在这。则应该输出Yes,否则输出No。
Sample
Input
Fgf fgfd rtet tyy tryt tytrtt
Dfdcdcnarutodsfsdf fdgfdfg
Output
No
Yes
Comments
include<iostream>
include<string>
using namespace std; int main() { string s; while(getline(cin,s)) { if(s.find("naruto")!=string::npos) cout<<"Yes"<<endl; else cout<<"No"<<endl; } return 0; }
include <iostream>
include <string>
using namespace std;
int main() { string s; while (getline(cin, s)) { if (s.find("naruto") != string::npos) { cout << "Yes" << endl; } else { cout << "No" << endl; } } return 0; }