結果

問題 No.207 世界のなんとか
ユーザー Suunn
提出日時 2018-11-22 09:26:23
言語 Java
(openjdk 23)
結果
AC  
実行時間 151 ms / 5,000 ms
コード長 422 bytes
コンパイル時間 2,517 ms
コンパイル使用メモリ 74,204 KB
実行使用メモリ 41,680 KB
最終ジャッジ日時 2024-12-24 16:17:51
合計ジャッジ時間 5,797 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
	

public class Main{
	
	
	public static void main(String args[])throws Exception{
		Scanner sc = new Scanner(System.in);

		int A = sc.nextInt();
		int B = sc.nextInt();
		for(int i=A;i<=B;i++){
			if(i%3==0||contain3(i)){
				System.out.println(i);
			}
		}
	}

	private static boolean contain3(int i) {
		while(i>1){
			if(i%10==3){
				return true;
			}
			i/=10;
		}
		return false;
	}
	

}
0