結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー greentea011
提出日時 2019-04-11 11:27:55
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 255 bytes
コンパイル時間 379 ms
コンパイル使用メモリ 29,824 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-18 08:54:50
合計ジャッジ時間 1,308 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1 WA * 28
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:16:11: warning: 'max' is used uninitialized [-Wuninitialized]
   16 |     printf("%d\n",max);
      |     ~~~~~~^~~~~~~~~~~~
main.cpp:5:9: note: 'max' was declared here
    5 |     int max;
      |         ^~~

ソースコード

diff #

#include <stdio.h>

int main() {
    char c;
    int max;
    int a=0;
    for (int i=0; i<14; i++) {
        if (a=='x') {
            max=(a>max)?a:max;
            a=0;
        }
        else {
            a++;
        }
    }
    printf("%d\n",max);
}
0