結果

問題 No.2460 #強調#
ユーザー Maeda
提出日時 2025-03-17 17:12:30
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 378 bytes
コンパイル時間 473 ms
コンパイル使用メモリ 24,704 KB
実行使用メモリ 7,324 KB
最終ジャッジ日時 2025-03-17 17:12:32
合計ジャッジ時間 1,365 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 11
権限があれば一括ダウンロードができます
コンパイルメッセージ
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",str);
      |         ^~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>
#include <stdbool.h>

void main(void) {
	char str[1000000] = "a";
	scanf("%s",str);
	bool emphasisFlg = false;
	int i = 0;
	while(str[i] != '\0'){
		
		if(!emphasisFlg && str[i] == '#'){
			emphasisFlg = true;
		}else if(emphasisFlg && str[i] != '#'){
			printf("%c", str[i] );
		}else if(emphasisFlg && str[i] == '#'){
			emphasisFlg = false;
		}
		i++;
	}
}
0