結果
問題 |
No.203 ゴールデン・ウィーク(1)
|
ユーザー |
![]() |
提出日時 | 2025-03-19 10:48:09 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 1,000 ms |
コード長 | 440 bytes |
コンパイル時間 | 296 ms |
コンパイル使用メモリ | 25,344 KB |
実行使用メモリ | 7,328 KB |
最終ジャッジ日時 | 2025-03-19 10:48:11 |
合計ジャッジ時間 | 1,420 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 29 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:6:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 6 | scanf("%s",week); | ^~~~~~~~~~~~~~~~ main.c:8:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 8 | scanf("%s",secondWeek); | ^~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> #include <string.h> void main(void){ char week[100] = "a"; scanf("%s",week); char secondWeek[100] = "a"; scanf("%s",secondWeek); strcat(week,secondWeek); int maxday = 0; int dayCount = 0; for(int i = 0 ; i < 14;i++){ if(week[i] == 'o'){ dayCount++; }else{ if(maxday < dayCount){ maxday = dayCount; } dayCount = 0; } } if(maxday < dayCount){ maxday = dayCount; } printf("%d",maxday); }