結果

問題 No.207 世界のなんとか
ユーザー TakaTaka
提出日時 2016-04-10 15:18:26
言語 Java21
(openjdk 21)
結果
AC  
実行時間 112 ms / 5,000 ms
コード長 542 bytes
コンパイル時間 2,070 ms
コンパイル使用メモリ 73,816 KB
実行使用メモリ 41,844 KB
最終ジャッジ日時 2024-04-17 16:43:49
合計ジャッジ時間 4,336 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 105 ms
41,684 KB
testcase_01 AC 104 ms
40,976 KB
testcase_02 AC 106 ms
40,960 KB
testcase_03 AC 108 ms
41,760 KB
testcase_04 AC 103 ms
41,404 KB
testcase_05 AC 97 ms
41,156 KB
testcase_06 AC 95 ms
41,436 KB
testcase_07 AC 104 ms
41,264 KB
testcase_08 AC 95 ms
41,136 KB
testcase_09 AC 111 ms
41,252 KB
testcase_10 AC 111 ms
41,528 KB
testcase_11 AC 106 ms
40,516 KB
testcase_12 AC 108 ms
41,324 KB
testcase_13 AC 112 ms
41,844 KB
testcase_14 AC 112 ms
41,276 KB
testcase_15 AC 112 ms
41,456 KB
testcase_16 AC 95 ms
41,324 KB
testcase_17 AC 105 ms
41,204 KB
testcase_18 AC 106 ms
41,788 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
		
        Scanner sc = new Scanner(System.in);
		
       	int A = sc.nextInt();
        int B = sc.nextInt();
		int i, j=0, x=A, y=B;
		char num;
		
		for(i=x; i<=y; i++)
		{
				if(i%3==0){
					System.out.println(i);
				}else{
					String i_string=String.valueOf(i);
					
					for(j=0; j<i_string.length(); j++)
					{
						num=i_string.charAt(j);
						if(num=='3'){
							System.out.println(i);
							break;
						}
					}
				}
		}
    }
}
0