結果
問題 |
No.3240 Count 8 Included Numbers (Easy)
|
ユーザー |
👑 |
提出日時 | 2025-08-16 10:32:54 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 220 bytes |
コンパイル時間 | 126 ms |
コンパイル使用メモリ | 26,700 KB |
実行使用メモリ | 7,716 KB |
最終ジャッジ日時 | 2025-08-22 20:30:07 |
合計ジャッジ時間 | 891 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 16 |
コンパイルメッセージ
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); | ^~~~~~~~~~~~~~~
ソースコード
#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; }