結果
問題 |
No.203 ゴールデン・ウィーク(1)
|
ユーザー |
![]() |
提出日時 | 2025-03-12 17:58:07 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 286 bytes |
コンパイル時間 | 331 ms |
コンパイル使用メモリ | 27,776 KB |
実行使用メモリ | 7,328 KB |
最終ジャッジ日時 | 2025-03-12 17:58:09 |
合計ジャッジ時間 | 1,650 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 1 WA * 28 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:8:25: warning: format ‘%s’ expects argument of type ‘char*’, but argument 2 has type ‘int*’ [-Wformat=] 8 | scanf("%s",str); | ~^ ~~~ | | | | | int* | char* | %d main.cpp:8:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 8 | scanf("%s",str); | ~~~~~^~~~~~~~~~
ソースコード
#include <stdio.h> int main(){ int str[7]; int max = 0; int count = 0; for(int i = 0;i < 2;i++){ scanf("%s",str); for(int j = 0;j < 7;j++){ if(str[j] == 'x'){ count = 0; if(count > max){ max = count; } }else{ count++; } } } printf("%d",max); }