結果

問題 No.207 世界のなんとか
ユーザー ちよちゃんちよちゃん
提出日時 2016-05-20 02:03:32
言語 Java21
(openjdk 21)
結果
AC  
実行時間 128 ms / 5,000 ms
コード長 512 bytes
コンパイル時間 2,846 ms
コンパイル使用メモリ 74,252 KB
実行使用メモリ 41,796 KB
最終ジャッジ日時 2024-04-17 16:49:04
合計ジャッジ時間 5,685 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
41,292 KB
testcase_01 AC 115 ms
41,128 KB
testcase_02 AC 106 ms
41,540 KB
testcase_03 AC 106 ms
41,256 KB
testcase_04 AC 118 ms
41,660 KB
testcase_05 AC 125 ms
41,388 KB
testcase_06 AC 117 ms
41,284 KB
testcase_07 AC 119 ms
41,296 KB
testcase_08 AC 119 ms
41,276 KB
testcase_09 AC 114 ms
41,796 KB
testcase_10 AC 121 ms
41,324 KB
testcase_11 AC 110 ms
41,796 KB
testcase_12 AC 120 ms
41,796 KB
testcase_13 AC 122 ms
41,280 KB
testcase_14 AC 128 ms
41,644 KB
testcase_15 AC 108 ms
41,496 KB
testcase_16 AC 117 ms
40,992 KB
testcase_17 AC 110 ms
41,392 KB
testcase_18 AC 111 ms
41,764 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

import java.util.Scanner;

public class Yuki3 {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		long a = scan.nextLong();
		long b = scan.nextLong();
		
		scan.close();
		for(long i= a; i <= b; i++) {
			
			if(i % 3 == 0 || digit(i) == true){
				System.out.println(i);
			}			
		}
	}
	
	static private boolean digit(long num) {
		
		while(num>0){
			long k1 = num %10;
			if (k1 == 3){
				return true;
			}
			num = num/10;
		}
		
		return false;
	}
}
0