結果

問題 No.2773 Wake up Record 1
ユーザー Maeda
提出日時 2025-03-19 13:53:58
言語 C
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 323 bytes
コンパイル時間 494 ms
コンパイル使用メモリ 25,728 KB
実行使用メモリ 7,328 KB
最終ジャッジ日時 2025-03-19 13:54:01
合計ジャッジ時間 2,071 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 22
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:7:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |         scanf("%d",&n);
      |         ^~~~~~~~~~~~~~
main.c:9:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    9 |         scanf("%s",sleep);
      |         ^~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

void main(void){
	int n = 0 ;
	scanf("%d",&n);
	char sleep[100000]  = "a"	;
	scanf("%s",sleep);
	int count = 0;
	for(int i = 1; i < n ; i++){
		if(sleep[i-1] == 'x' && sleep[i] == 'o'){
			printf("%d ",i+1);
			count++;
		}
	}
	if(count == 0){
		printf("0");
	}
}
0