結果
| 問題 |
No.203 ゴールデン・ウィーク(1)
|
| コンテスト | |
| ユーザー |
Maeda
|
| 提出日時 | 2025-03-10 10:16:52 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 440 bytes |
| コンパイル時間 | 403 ms |
| コンパイル使用メモリ | 25,472 KB |
| 実行使用メモリ | 7,328 KB |
| 最終ジャッジ日時 | 2025-03-10 10:16:58 |
| 合計ジャッジ時間 | 4,806 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | RE * 29 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:11:26: warning: assignment to ‘char’ from ‘char *’ makes integer from pointer without a cast [-Wint-conversion]
11 | goldenWeek [100] = strcat(week[0], week[1]);
| ^
main.c:9:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
9 | scanf("%s\n%s\n",week[0],week[1]);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <string.h>
#define MaxDay (14)
void main(void){
int longestDay = 0;
char week[2][100] = {"a","a"};
scanf("%s\n%s\n",week[0],week[1]);
char *goldenWeek;
goldenWeek [100] = strcat(week[0], week[1]);
int count = 0;
for(int i = 0 ; i < MaxDay ; i++){
if(goldenWeek[i] == 'o'){
count++;
}else{
if(longestDay < count){
longestDay = count;
}
count = 0;
}
}
printf("%d\n",longestDay);
}
Maeda