結果

問題 No.207 世界のなんとか
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2016-11-12 21:27:01
言語 Java21
(openjdk 21)
結果
AC  
実行時間 141 ms / 5,000 ms
コード長 622 bytes
コンパイル時間 2,322 ms
コンパイル使用メモリ 74,668 KB
実行使用メモリ 41,976 KB
最終ジャッジ日時 2024-05-04 11:06:57
合計ジャッジ時間 5,614 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
41,440 KB
testcase_01 AC 134 ms
41,976 KB
testcase_02 AC 141 ms
41,616 KB
testcase_03 AC 139 ms
41,708 KB
testcase_04 AC 136 ms
41,720 KB
testcase_05 AC 140 ms
41,644 KB
testcase_06 AC 137 ms
41,312 KB
testcase_07 AC 137 ms
41,332 KB
testcase_08 AC 137 ms
41,268 KB
testcase_09 AC 141 ms
41,596 KB
testcase_10 AC 141 ms
41,672 KB
testcase_11 AC 141 ms
41,592 KB
testcase_12 AC 139 ms
41,656 KB
testcase_13 AC 141 ms
41,780 KB
testcase_14 AC 141 ms
41,488 KB
testcase_15 AC 137 ms
41,324 KB
testcase_16 AC 133 ms
41,488 KB
testcase_17 AC 133 ms
41,764 KB
testcase_18 AC 134 ms
41,588 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