結果

問題 No.207 世界のなんとか
ユーザー eagleeagle
提出日時 2022-05-26 14:31:42
言語 Java21
(openjdk 21)
結果
AC  
実行時間 138 ms / 5,000 ms
コード長 487 bytes
コンパイル時間 2,013 ms
コンパイル使用メモリ 74,136 KB
実行使用メモリ 57,472 KB
最終ジャッジ日時 2023-10-20 19:26:27
合計ジャッジ時間 5,562 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
57,464 KB
testcase_01 AC 132 ms
57,408 KB
testcase_02 AC 138 ms
57,332 KB
testcase_03 AC 134 ms
57,452 KB
testcase_04 AC 131 ms
57,280 KB
testcase_05 AC 134 ms
57,160 KB
testcase_06 AC 131 ms
57,464 KB
testcase_07 AC 132 ms
57,336 KB
testcase_08 AC 132 ms
57,464 KB
testcase_09 AC 134 ms
57,452 KB
testcase_10 AC 136 ms
57,312 KB
testcase_11 AC 134 ms
57,308 KB
testcase_12 AC 135 ms
55,616 KB
testcase_13 AC 136 ms
57,312 KB
testcase_14 AC 136 ms
57,472 KB
testcase_15 AC 137 ms
57,268 KB
testcase_16 AC 132 ms
57,460 KB
testcase_17 AC 131 ms
57,372 KB
testcase_18 AC 130 ms
57,236 KB
権限があれば一括ダウンロードができます

ソースコード

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