結果

問題 No.207 世界のなんとか
ユーザー aparachia14aparachia14
提出日時 2015-12-23 01:29:30
言語 Java21
(openjdk 21)
結果
AC  
実行時間 56 ms / 5,000 ms
コード長 1,219 bytes
コンパイル時間 3,621 ms
コンパイル使用メモリ 75,440 KB
実行使用メモリ 37,008 KB
最終ジャッジ日時 2024-04-17 16:32:36
合計ジャッジ時間 5,246 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 53 ms
36,864 KB
testcase_01 AC 52 ms
36,952 KB
testcase_02 AC 55 ms
36,836 KB
testcase_03 AC 53 ms
36,884 KB
testcase_04 AC 53 ms
36,756 KB
testcase_05 AC 53 ms
36,896 KB
testcase_06 AC 51 ms
36,956 KB
testcase_07 AC 52 ms
36,848 KB
testcase_08 AC 52 ms
37,008 KB
testcase_09 AC 53 ms
36,896 KB
testcase_10 AC 53 ms
36,800 KB
testcase_11 AC 54 ms
36,732 KB
testcase_12 AC 55 ms
36,408 KB
testcase_13 AC 56 ms
36,820 KB
testcase_14 AC 55 ms
36,412 KB
testcase_15 AC 53 ms
36,524 KB
testcase_16 AC 52 ms
36,920 KB
testcase_17 AC 51 ms
36,868 KB
testcase_18 AC 51 ms
36,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

public class Nabeatsu {

	public static void main(String[] args) throws IOException {
		// TODO 自動生成されたメソッド・スタブ
		//入力値
		String input;
		//入力された値を分割した際に格納する配列。0番目が最小値1番目が最大値
		String[] splited;
		//入力した最小値と最大値の間の数を格納するためのArrayList
		ArrayList<Integer> numbers = new ArrayList<Integer>();
		
		//入力値の入力
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		input = in.readLine();
		
		//入力値の分割
		splited = input.split(" ");
		
		//for文でArrayListに格納する。
		for(int i = Integer.parseInt(splited[0]);i <= Integer.parseInt(splited[1]);i++){
			numbers.add(i);
		}
		
		//ArrayListに格納されている数字が3の倍数または3のつく数字なら出力する。
		for(int temp:numbers){
			String judge = String.valueOf(temp);
			if(temp % 3 == 0){
				System.out.println(temp);
			}else if(judge.indexOf("3") != -1){
				System.out.println(temp);
			}else{
				
			}
		}

	}

}
0