結果

問題 No.207 世界のなんとか
ユーザー yugi0922yugi0922
提出日時 2020-06-24 20:34:35
言語 Java19
(openjdk 21)
結果
AC  
実行時間 119 ms / 5,000 ms
コード長 920 bytes
コンパイル時間 3,333 ms
コンパイル使用メモリ 71,868 KB
実行使用メモリ 55,880 KB
最終ジャッジ日時 2023-09-16 21:18:53
合計ジャッジ時間 6,591 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
55,368 KB
testcase_01 AC 112 ms
55,860 KB
testcase_02 AC 117 ms
55,868 KB
testcase_03 AC 114 ms
55,880 KB
testcase_04 AC 114 ms
55,868 KB
testcase_05 AC 119 ms
55,684 KB
testcase_06 AC 115 ms
55,740 KB
testcase_07 AC 115 ms
55,480 KB
testcase_08 AC 110 ms
55,484 KB
testcase_09 AC 115 ms
55,620 KB
testcase_10 AC 114 ms
55,572 KB
testcase_11 AC 113 ms
55,608 KB
testcase_12 AC 116 ms
55,624 KB
testcase_13 AC 113 ms
55,780 KB
testcase_14 AC 115 ms
55,700 KB
testcase_15 AC 115 ms
55,848 KB
testcase_16 AC 112 ms
55,760 KB
testcase_17 AC 108 ms
55,480 KB
testcase_18 AC 108 ms
55,556 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import static java.lang.System.*;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;

public class worldNabeatsu {
	public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
		BufferedReader reader = new BufferedReader(new InputStreamReader(in));
		String[] inputs = reader.readLine().split(" ");
		int startNum = Integer.parseInt(inputs[0]);
		int endNum = Integer.parseInt(inputs[1]);
		for(int i = startNum; i <= endNum; i++){
			if(validThree(i)){
				System.out.println(i);
			}
		}
	}
	static boolean validThree(int num){
		boolean threeFlg = false;
		String str = String.valueOf(num);
		char[] charBox = str.toCharArray();
		for(int i = 0; i < charBox.length; i++){
			if(charBox[i] == '3'){
				threeFlg = true;
			}
		}
		if(num % 3 == 0 || threeFlg ){
			return true;
		}
		return false;

	}
}
0