結果

問題 No.207 世界のなんとか
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2016-11-12 21:27:01
言語 Java21
(openjdk 21)
結果
AC  
実行時間 131 ms / 5,000 ms
コード長 622 bytes
コンパイル時間 2,437 ms
コンパイル使用メモリ 71,544 KB
実行使用メモリ 56,128 KB
最終ジャッジ日時 2023-08-17 03:57:31
合計ジャッジ時間 6,020 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,360 KB
testcase_01 AC 125 ms
55,988 KB
testcase_02 AC 131 ms
55,720 KB
testcase_03 AC 129 ms
55,608 KB
testcase_04 AC 127 ms
55,780 KB
testcase_05 AC 129 ms
55,388 KB
testcase_06 AC 122 ms
55,372 KB
testcase_07 AC 125 ms
55,616 KB
testcase_08 AC 125 ms
55,780 KB
testcase_09 AC 131 ms
55,688 KB
testcase_10 AC 127 ms
55,844 KB
testcase_11 AC 126 ms
55,888 KB
testcase_12 AC 129 ms
55,924 KB
testcase_13 AC 128 ms
55,928 KB
testcase_14 AC 125 ms
56,128 KB
testcase_15 AC 123 ms
55,836 KB
testcase_16 AC 123 ms
55,564 KB
testcase_17 AC 121 ms
55,676 KB
testcase_18 AC 124 ms
55,700 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        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);
                continue;
            }else{
                String t = Integer.toString(i);
                for(int j=0; j<t.length(); j++){
                    if( '3'==t.charAt(j) ){
                        System.out.println(i);
                        break;
                    }
                }
            }
        }
    }
}
0