結果

問題 No.207 世界のなんとか
ユーザー kaoetayakaoetaya
提出日時 2016-12-07 21:58:11
言語 Java21
(openjdk 21)
結果
AC  
実行時間 131 ms / 5,000 ms
コード長 538 bytes
コンパイル時間 5,833 ms
コンパイル使用メモリ 71,680 KB
実行使用メモリ 56,152 KB
最終ジャッジ日時 2023-08-18 19:52:53
合計ジャッジ時間 6,619 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
55,344 KB
testcase_01 AC 125 ms
55,508 KB
testcase_02 AC 131 ms
55,392 KB
testcase_03 AC 128 ms
55,904 KB
testcase_04 AC 126 ms
55,944 KB
testcase_05 AC 131 ms
55,384 KB
testcase_06 AC 124 ms
55,952 KB
testcase_07 AC 126 ms
55,532 KB
testcase_08 AC 125 ms
55,388 KB
testcase_09 AC 128 ms
55,888 KB
testcase_10 AC 128 ms
55,604 KB
testcase_11 AC 129 ms
55,680 KB
testcase_12 AC 131 ms
56,152 KB
testcase_13 AC 131 ms
55,596 KB
testcase_14 AC 130 ms
55,892 KB
testcase_15 AC 129 ms
55,564 KB
testcase_16 AC 126 ms
55,580 KB
testcase_17 AC 126 ms
55,612 KB
testcase_18 AC 125 ms
55,552 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Test{
    public static void main(String[] args){
        Scanner s = new Scanner(System.in);
         int a = s.nextInt(),b = s.nextInt();

        for(int i=a;i<=b;i++){
        	if(i%3 == 0){
        		System.out.println(i);
        		continue;
        	}
        	else{
        		String str = String.valueOf(i);

        		for(int j=0;j<str.length();j++){
        			if(str.charAt(j) == '3'){
        				System.out.println(i);
        				break;
        			}
        		}
        	}
        }
    }
}
0