https://www.acmicpc.net/problem/10173
이 문제의 핵심은
while (true) 문을 이용해 입력이 "EOI"일때까지 입력받기find("문자열") 을 이용해 "nemo" 찾기 (이때 조건 분기를 하지 않기 위해 모두 소문자로 변환해준 뒤 찾는게 좋다!)#include <iostream>
#include <string>
using namespace std;
int main() {
string input;
while (true) {
getline(cin, input);
if (input == "EOI") break;
for (int i = 0; i < input.length(); i++) {
input[i] = tolower(input[i]);
}
if (input.find("nemo") != string::npos) cout << "Found" << endl;
else cout << "Missing" << endl;
}
return 0;
}