L1-070 吃火锅

#include <bits/stdc++.h>
using namespace std;
int main() {
	int count =0,huoguo=0;
	int flag = 0;//第一次出现是第几条
	string s;
	while (getline(cin, s) && s != ".") {
		count++;
		if (s.find("chi1 huo3 guo1")!=string::npos) {
			if (flag == 0) {
				flag = count;
			}
			huoguo++;
		}
	}
	cout << count << '\n';
	if (!huoguo) {
		cout << "-_-#";
	}
	else {
		cout << flag << " " << huoguo << '\n';
	}
	return 0;
}
posted @ 2024-03-29 20:11  YuKiCheng  阅读(20)  评论(0编辑  收藏  举报