結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー Maeda
提出日時 2025-03-10 10:38:55
言語 C
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 549 bytes
コンパイル時間 396 ms
コンパイル使用メモリ 25,344 KB
実行使用メモリ 7,328 KB
最終ジャッジ日時 2025-03-10 10:38:57
合計ジャッジ時間 1,733 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 29
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:9:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    9 |         scanf("%s\n",firstweek);
      |         ^~~~~~~~~~~~~~~~~~~~~~~
main.c:11:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   11 |         scanf("%s\n",secondweek);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>
#include <string.h> //文字列の連結に必要なもの
#define MaxDay (14) //定数

void main(void){
	
	int longestDay = 0;
	char firstweek[100] = "a";
	scanf("%s\n",firstweek);
	char secondweek[100] = "b";
	scanf("%s\n",secondweek);
	char *goldenWeek;
	strcat(firstweek, secondweek);
	int count = 0;
	for(int i = 0 ; i < MaxDay ; i++){
		printf("%c",firstweek[i]);
		if(firstweek[i] == 'o'){
			count++;
		}else{
			if(longestDay > count){
				longestDay = count;
				
			}
			count = 0;
		}
	}
	printf("%d\n",longestDay);
}
0