結果

問題 No.207 世界のなんとか
ユーザー yugi0922yugi0922
提出日時 2020-06-24 20:32:39
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 919 bytes
コンパイル時間 3,394 ms
コンパイル使用メモリ 72,716 KB
実行使用メモリ 57,436 KB
最終ジャッジ日時 2023-09-16 21:18:45
合計ジャッジ時間 6,767 ms
ジャッジサーバーID
(参考情報)
judge13 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 124 ms
55,616 KB
testcase_04 AC 122 ms
55,564 KB
testcase_05 WA -
testcase_06 AC 120 ms
55,480 KB
testcase_07 AC 122 ms
55,480 KB
testcase_08 AC 122 ms
55,944 KB
testcase_09 AC 128 ms
55,316 KB
testcase_10 WA -
testcase_11 AC 127 ms
55,844 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 126 ms
55,604 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 121 ms
55,552 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