結果

問題 No.207 世界のなんとか
ユーザー S1hoS1ho
提出日時 2017-02-19 11:59:14
言語 Java21
(openjdk 21)
結果
AC  
実行時間 125 ms / 5,000 ms
コード長 723 bytes
コンパイル時間 4,866 ms
コンパイル使用メモリ 71,816 KB
実行使用メモリ 56,228 KB
最終ジャッジ日時 2023-08-28 19:05:45
合計ジャッジ時間 6,789 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
56,008 KB
testcase_01 AC 118 ms
56,228 KB
testcase_02 AC 122 ms
55,440 KB
testcase_03 AC 120 ms
55,940 KB
testcase_04 AC 118 ms
55,640 KB
testcase_05 AC 122 ms
56,128 KB
testcase_06 AC 117 ms
55,964 KB
testcase_07 AC 115 ms
55,444 KB
testcase_08 AC 118 ms
55,608 KB
testcase_09 AC 120 ms
55,436 KB
testcase_10 AC 122 ms
56,036 KB
testcase_11 AC 122 ms
55,776 KB
testcase_12 AC 125 ms
55,900 KB
testcase_13 AC 122 ms
55,876 KB
testcase_14 AC 124 ms
56,060 KB
testcase_15 AC 122 ms
55,452 KB
testcase_16 AC 117 ms
56,064 KB
testcase_17 AC 116 ms
56,024 KB
testcase_18 AC 116 ms
56,056 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class WorldN {

    public static void main(String[] args) {
       
        int a;
        int b;
        
        Scanner scanner = new Scanner(System.in);
        
        a = scanner.nextInt();
        b = scanner.nextInt();
        
        for(int i=a;i<=b;i++){
            if(i % 3 == 0 || isThree(i))
                 System.out.println(i);
            
        }
    }
    
    static boolean isThree(int num){
        
        String str = String.valueOf(num);
        
        for(int i=0;i<str.length();i++){
          
            if(str.charAt(i) == '3'){
                return true;
            }
            
        }
        
        return false;
        
    }
    
}
0