結果

問題 No.207 世界のなんとか
ユーザー n_gojon_gojo
提出日時 2020-04-09 11:34:25
言語 Java21
(openjdk 21)
結果
AC  
実行時間 119 ms / 5,000 ms
コード長 751 bytes
コンパイル時間 3,977 ms
コンパイル使用メモリ 71,724 KB
実行使用メモリ 56,420 KB
最終ジャッジ日時 2023-09-29 16:47:44
合計ジャッジ時間 7,438 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
55,936 KB
testcase_01 AC 111 ms
56,420 KB
testcase_02 AC 119 ms
55,780 KB
testcase_03 AC 113 ms
55,988 KB
testcase_04 AC 113 ms
56,064 KB
testcase_05 AC 119 ms
55,652 KB
testcase_06 AC 110 ms
55,704 KB
testcase_07 AC 112 ms
55,600 KB
testcase_08 AC 110 ms
56,244 KB
testcase_09 AC 113 ms
55,684 KB
testcase_10 AC 114 ms
55,972 KB
testcase_11 AC 110 ms
55,684 KB
testcase_12 AC 111 ms
55,860 KB
testcase_13 AC 113 ms
55,700 KB
testcase_14 AC 112 ms
55,776 KB
testcase_15 AC 110 ms
54,500 KB
testcase_16 AC 114 ms
55,864 KB
testcase_17 AC 112 ms
56,248 KB
testcase_18 AC 114 ms
55,844 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No207 {
    public static void main(String[] args) {
        // 標準入力から読み込む際に、Scannerオブジェクトを使う。
        Scanner sc = new Scanner(System.in);

        // int 1つ分を読み込む
        int a = sc.nextInt();
        int b = sc.nextInt();
        
        for (int i = a; i<=b; i++) {
            int check = i;
            if (check%3==0) {
                System.out.println(i);
            } else {
                while (check > 0) {
                    if (check%10 == 3) {
                        System.out.println(i);
                        break;
                    }
                    check /= 10;
                }
            }
        }

    }
}
0