結果

問題 No.207 世界のなんとか
ユーザー A_rinataroA_rinataro
提出日時 2015-09-19 14:52:21
言語 Java21
(openjdk 21)
結果
AC  
実行時間 125 ms / 5,000 ms
コード長 501 bytes
コンパイル時間 2,511 ms
コンパイル使用メモリ 74,124 KB
実行使用メモリ 41,700 KB
最終ジャッジ日時 2024-04-17 16:25:11
合計ジャッジ時間 4,910 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
41,036 KB
testcase_01 AC 106 ms
40,032 KB
testcase_02 AC 106 ms
39,692 KB
testcase_03 AC 122 ms
41,476 KB
testcase_04 AC 123 ms
41,200 KB
testcase_05 AC 124 ms
41,700 KB
testcase_06 AC 107 ms
39,896 KB
testcase_07 AC 109 ms
40,236 KB
testcase_08 AC 108 ms
40,064 KB
testcase_09 AC 123 ms
41,180 KB
testcase_10 AC 122 ms
41,464 KB
testcase_11 AC 125 ms
41,572 KB
testcase_12 AC 117 ms
40,052 KB
testcase_13 AC 124 ms
41,032 KB
testcase_14 AC 115 ms
40,212 KB
testcase_15 AC 125 ms
41,284 KB
testcase_16 AC 116 ms
41,276 KB
testcase_17 AC 118 ms
41,108 KB
testcase_18 AC 116 ms
40,892 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		
		int a = scan.nextInt();
		int b = scan.nextInt();
		int n = 1;
		int x = 0;
		
		for(int i = a; i <= b; i++) {
			if(i % 3 == 0) {
				System.out.println(i);
			} else {
				x = i;
				while(n > 0) {
					if(x % 10 == 3) {
						System.out.println(i);
						break;
					} else {
						x = x / 10;
						if(x == 0) {
							break;
						}
					}
				}
			}
		}		
	}
}
0