結果

問題 No.207 世界のなんとか
ユーザー eagle
提出日時 2022-05-26 14:31:42
言語 Java
(openjdk 23)
結果
AC  
実行時間 115 ms / 5,000 ms
コード長 487 bytes
コンパイル時間 1,882 ms
コンパイル使用メモリ 73,904 KB
実行使用メモリ 41,444 KB
最終ジャッジ日時 2024-09-20 14:59:45
合計ジャッジ時間 4,837 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		for(int i = A; i <= B; i++) {
			if(i % 3 == 0) {
				System.out.println(i);
			} else {
				int num = i;
				while(num > 0) {
					if(num % 10 == 3) {
						System.out.println(i);
						break;
					} else {
						num /= 10;
					}
				}
			}
		}
	}
}
0