結果

問題 No.908 うしたぷにきあくん文字列
コンテスト
ユーザー Maeda
提出日時 2025-03-11 14:51:38
言語 C(gnu17)
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -std=gnu17 -Wno-error=implicit-function-declaration -Wno-error=implicit-int -Wno-error=incompatible-pointer-types -Wno-error=int-conversion -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 400 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 656 ms
コンパイル使用メモリ 37,616 KB
実行使用メモリ 7,968 KB
最終ジャッジ日時 2026-02-22 20:10:18
合計ジャッジ時間 1,365 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 2
other RE * 18
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function 'main':
main.c:8:5: warning: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
    8 |     gets(s);
      |     ^~~~
      |     fgets
/usr/bin/ld: /tmp/ccH1BWIW.o: in function `main':
main.c:(.text.startup+0x2c): 警告: the `gets' function is dangerous and should not be used.

ソースコード

diff #
raw source code

#include <stdio.h>
#include <string.h>
#include <stdbool.h>

void main(void){
    char s[1000] = "a";
    bool strcheck = true;
    gets(s);
    for(int i = 0 ; i < (int)strlen(s);i++){
        if(s[i] == ' ' && i % 2 == 0 || s[i] != ' ' && i % 2 != 0){
            strcheck = false;
            break;
        }
    }
    if(strcheck){
        printf("Yes");
    }else{
        printf("No");
    }
}
0