結果

問題 No.207 世界のなんとか
ユーザー MatumoMatumo
提出日時 2018-07-13 02:42:40
言語 Java21
(openjdk 21)
結果
AC  
実行時間 179 ms / 5,000 ms
コード長 405 bytes
コンパイル時間 2,630 ms
コンパイル使用メモリ 74,972 KB
実行使用メモリ 54,740 KB
最終ジャッジ日時 2024-04-15 10:01:36
合計ジャッジ時間 6,743 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 158 ms
54,032 KB
testcase_01 AC 163 ms
54,512 KB
testcase_02 AC 172 ms
53,936 KB
testcase_03 AC 166 ms
54,188 KB
testcase_04 AC 161 ms
54,216 KB
testcase_05 AC 170 ms
54,476 KB
testcase_06 AC 165 ms
54,072 KB
testcase_07 AC 159 ms
54,172 KB
testcase_08 AC 163 ms
54,228 KB
testcase_09 AC 165 ms
54,164 KB
testcase_10 AC 168 ms
53,852 KB
testcase_11 AC 167 ms
54,128 KB
testcase_12 AC 179 ms
54,224 KB
testcase_13 AC 172 ms
54,456 KB
testcase_14 AC 167 ms
54,740 KB
testcase_15 AC 171 ms
54,352 KB
testcase_16 AC 159 ms
53,804 KB
testcase_17 AC 154 ms
54,340 KB
testcase_18 AC 165 ms
53,844 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		int a = sc.nextInt();
		int b = sc.nextInt();

		for(int i = a; i <= b; i++) {
			if(i % 3 == 0) {
				System.out.println(i);
				continue;
			}
			for(int j = i; j != 0; j /= 10) {
				if(j % 10 == 3) {
					System.out.println(i);
					break;
				}
			}
		}
    }
}
0