結果

問題 No.207 世界のなんとか
ユーザー ぴろずぴろず
提出日時 2015-05-15 22:22:02
言語 Java
(openjdk 23)
結果
AC  
実行時間 138 ms / 5,000 ms
コード長 459 bytes
コンパイル時間 1,965 ms
コンパイル使用メモリ 74,136 KB
実行使用メモリ 41,780 KB
最終ジャッジ日時 2024-10-09 09:19:02
合計ジャッジ時間 5,282 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

package no207;

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long a = sc.nextLong();
		long b = sc.nextLong();
		for(long x=a;x<=b;x++) {
			if (isAho(x)) {
				System.out.println(x);
			}
		}
	}

	public static boolean isAho(long n) {
		if (n % 3 == 0) {
			return true;
		}
		while(n > 0) {
			if (n % 10 == 3) {
				return true;
			}
			n/=10;
		}
		return false;
	}

}
0