pta编译器不支持gets(),改为cin.getline(s,85)。
#include<bits/stdc++.h>
using namespace std;
int main(){
int flagcout=0,cout=1,first=0,flag=0;
char s[85];
//gets(s); pta编译器不支持gets(),改为cin.getline(s,85);
cin.getline(s,85);
while(strcmp(s,".")!=0){
if(strstr(s,"chi1 huo3 guo1")){
if(flag==0){
first=cout;
}
flag=1;
flagcout++;
}
//gets(s);
cin.getline(s,85);
cout++;
}
printf("%d\n",cout-1);
if(flagcout==0){
printf("-_-#");
}else{
printf("%d %d",first,flagcout);
}
return 0;
}