結果
問題 | No.203 ゴールデン・ウィーク(1) |
ユーザー |
![]() |
提出日時 | 2025-03-12 17:58:47 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 286 bytes |
コンパイル時間 | 255 ms |
コンパイル使用メモリ | 28,288 KB |
実行使用メモリ | 7,328 KB |
最終ジャッジ日時 | 2025-03-12 17:58:49 |
合計ジャッジ時間 | 1,525 ms |
ジャッジサーバーID (参考情報) |
judge5 / 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'){if(count > max){max = count;}count = 0;}else{count++;}}}printf("%d",max);}