#include #include #define LEFT "(^^*)" #define RIGHT "(*^^)" #define YAZYU "(≧Д≦)" int main(void){ char str[100000]; char *str_p = NULL; char *left_p = LEFT; char *right_p = RIGHT; char *yjsnp_naa = YAZYU; char str_tmp[6]; int str_tmp_sfx = 0; int left_cnt = 0; int right_cnt = 0; scanf("%s", str); str_p = str; while(strcmp((char *)str_p, "#")){ str_tmp[str_tmp_sfx] = *str_p; str_p++; str_tmp_sfx++; if(str_tmp_sfx == 5 ){ str_tmp_sfx = 0; if(!strcmp(str_tmp, left_p)){ left_cnt++; } if(!strcmp(str_tmp, right_p)){ right_cnt++; } if(!strcmp(str_tmp, yjsnp_naa)){ while(1){ printf("%s\n", yjsnp_naa); } } } } printf("%d %d\n", left_cnt, right_cnt); }