結果
問題 | No.495 (^^*) Easy |
ユーザー |
![]() |
提出日時 | 2019-03-08 15:04:00 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 1,038 bytes |
コンパイル時間 | 362 ms |
コンパイル使用メモリ | 28,288 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-23 15:02:04 |
合計ジャッジ時間 | 654 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 7 |
ソースコード
#include <stdio.h>#include <string.h>#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);}