結果

問題 No.495 (^^*) Easy
ユーザー Fre_de_ricaFre_de_rica
提出日時 2019-03-08 15:04:00
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 1,038 bytes
コンパイル時間 91 ms
コンパイル使用メモリ 27,480 KB
実行使用メモリ 4,376 KB
最終ジャッジ日時 2023-09-05 19:39:37
合計ジャッジ時間 642 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 0 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 0 ms
4,376 KB
testcase_04 AC 0 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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);
    
}
0