結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー githide3
提出日時 2018-08-25 10:24:04
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 1,000 ms
コード長 569 bytes
コンパイル時間 154 ms
コンパイル使用メモリ 28,416 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-18 10:31:54
合計ジャッジ時間 957 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

#include    <stdio.h>

int main(void)
{
    char    c;
    int     n, max, lf;

    lf = 0;
    max = 0;
    n = 0;
    while ((c = getchar()) != EOF) {
        switch (c) {
          case 'x':
            max = n > max ? n : max;
            n = 0;
            break;
          case 'o':
            n++;
            break;
          case '\n':
            lf++;
            break;
          default:
            break;
        }
        if (lf >= 2) {
            max = n > max ? n : max;
            break;
        }
    }

    printf("%d\n", max);

    return 0;
}
0