結果

問題 No.207 世界のなんとか
ユーザー joicii3joicii3
提出日時 2019-08-11 20:16:55
言語 Java21
(openjdk 21)
結果
AC  
実行時間 133 ms / 5,000 ms
コード長 777 bytes
コンパイル時間 2,496 ms
コンパイル使用メモリ 72,024 KB
実行使用メモリ 55,956 KB
最終ジャッジ日時 2023-10-12 00:24:21
合計ジャッジ時間 6,077 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,288 KB
testcase_01 AC 121 ms
55,944 KB
testcase_02 AC 127 ms
55,568 KB
testcase_03 AC 123 ms
55,612 KB
testcase_04 AC 122 ms
55,340 KB
testcase_05 AC 124 ms
55,404 KB
testcase_06 AC 125 ms
55,836 KB
testcase_07 AC 121 ms
55,672 KB
testcase_08 AC 120 ms
55,508 KB
testcase_09 AC 123 ms
55,508 KB
testcase_10 AC 121 ms
55,712 KB
testcase_11 AC 124 ms
55,616 KB
testcase_12 AC 124 ms
55,880 KB
testcase_13 AC 127 ms
55,636 KB
testcase_14 AC 133 ms
55,620 KB
testcase_15 AC 126 ms
55,612 KB
testcase_16 AC 126 ms
55,500 KB
testcase_17 AC 122 ms
55,536 KB
testcase_18 AC 124 ms
55,956 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int start = Integer.parseInt(sc.next());
        int end = Integer.parseInt(sc.next());
        boolean printFlg = false;
        for (int i = start; i <= end; i++) {
            String toStr = Integer.toString(i);
            for (int j = 0; j < toStr.length(); j++) {
                if (toStr.charAt(j) == '3') {
                    printFlg = true;
                    break;
                }
            }
            if (i % 3 == 0) {
                printFlg = true;
            }
            if (printFlg) {
                System.out.println(i);   
            }
            printFlg = false;
        }
    }
}
0