結果

問題 No.3240 Count 8 Included Numbers (Easy)
ユーザー Maeda
提出日時 2025-08-26 09:32:04
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 323 bytes
コンパイル時間 2,322 ms
コンパイル使用メモリ 77,420 KB
実行使用メモリ 46,784 KB
最終ジャッジ日時 2025-08-26 09:32:11
合計ジャッジ時間 6,264 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 2
other WA * 16
権限があれば一括ダウンロードができます

ソースコード

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++){
			String str = String.valueOf(i);
			if( str.equals("8") ){
				count++; 
			}
		}
		System.out.println(count);
    }
}
0