結果

問題 No.3240 Count 8 Included Numbers (Easy)
ユーザー Maeda
提出日時 2025-08-26 09:10:17
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 299 bytes
コンパイル時間 2,210 ms
コンパイル使用メモリ 76,560 KB
実行使用メモリ 46,772 KB
最終ジャッジ日時 2025-08-26 09:10:25
合計ジャッジ時間 5,814 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 WA * 1
other AC * 3 WA * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int count = 0;
		for(int i = 1 ; i <= n ; i++){
			if( i % 10 == 8 || i / 10 == 8 ){
				count++; 
			}
		}
		System.out.println(count);
    }
}
0