L1-070 吃火锅 分数 15

foundPos == std::string::npos // 说明没有查找到
// 9'15"
#include <bits/stdc++.h>
using namespace std;
int main()
{
    string s;
    int cnt = 0, first = 0, potcnt = 0;
    while(getline(cin,s))
    {
        if(s == ".") break;
        ++ cnt;
        if(s.find("chi1 huo3 guo1", 0) != string::npos)
        	first = (potcnt ++ == 0 ? cnt : first);
    }
    cout << cnt << endl;
    if(potcnt == 0) cout << "-_-#";
    else cout << first << " " << potcnt;
    return 0;
}
posted @ 2024-08-16 21:35  Frodnx  阅读(13)  评论(0)    收藏  举报