結果

問題 No.3242 Count 8 Included Numbers (Hard)
ユーザー 👑 ygussany
提出日時 2025-08-16 10:32:41
言語 C
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 220 bytes
コンパイル時間 278 ms
コンパイル使用メモリ 26,572 KB
実行使用メモリ 7,720 KB
最終ジャッジ日時 2025-08-16 10:32:43
合計ジャッジ時間 1,967 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4 WA * 1
other AC * 1 WA * 19
権限があれば一括ダウンロードができます
コンパイルメッセージ
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("%d", &N);
      |         ^~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

int main()
{
	int N;
	scanf("%d", &N);
	
	int n, ans = 0;
	for (n = 1; n <= N; n++) if (n % 10 == 8 || n / 10 % 10 == 8 || n / 100 % 10 == 8) ans++;
	printf("%d\n", ans);
	fflush(stdout);
	return 0;
}
0