結果
| 問題 |
No.203 ゴールデン・ウィーク(1)
|
| コンテスト | |
| ユーザー |
Maeda
|
| 提出日時 | 2025-03-19 10:47:27 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 392 bytes |
| コンパイル時間 | 438 ms |
| コンパイル使用メモリ | 25,344 KB |
| 実行使用メモリ | 7,324 KB |
| 最終ジャッジ日時 | 2025-03-19 10:47:29 |
| 合計ジャッジ時間 | 1,306 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 24 WA * 5 |
コンパイルメッセージ
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;
}
}
printf("%d",maxday);
}
Maeda