結果

問題 No.207 世界のなんとか
ユーザー kenji_shioyakenji_shioya
提出日時 2016-06-23 01:33:20
言語 Java21
(openjdk 21)
結果
AC  
実行時間 129 ms / 5,000 ms
コード長 547 bytes
コンパイル時間 3,127 ms
コンパイル使用メモリ 74,656 KB
実行使用メモリ 54,416 KB
最終ジャッジ日時 2024-04-20 00:59:05
合計ジャッジ時間 6,201 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
54,008 KB
testcase_01 AC 119 ms
54,180 KB
testcase_02 AC 123 ms
53,224 KB
testcase_03 AC 123 ms
54,068 KB
testcase_04 AC 123 ms
54,128 KB
testcase_05 AC 112 ms
52,780 KB
testcase_06 AC 124 ms
54,228 KB
testcase_07 AC 119 ms
54,108 KB
testcase_08 AC 108 ms
53,164 KB
testcase_09 AC 126 ms
54,152 KB
testcase_10 AC 114 ms
52,828 KB
testcase_11 AC 129 ms
54,416 KB
testcase_12 AC 115 ms
53,156 KB
testcase_13 AC 112 ms
53,132 KB
testcase_14 AC 126 ms
53,972 KB
testcase_15 AC 124 ms
53,920 KB
testcase_16 AC 116 ms
53,656 KB
testcase_17 AC 122 ms
54,044 KB
testcase_18 AC 123 ms
54,108 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Exercises4{
  public static void main (String[] args){

    Scanner sc = new Scanner(System.in);

    int firstNum = sc.nextInt();
    int secondNum = sc.nextInt();

    for(int n = firstNum; n <= secondNum; n++){
      if (n % 3 == 0 || isThreeExist(n)){
        System.out.println(n);
      }
    }
  }
  private static boolean isThreeExist(int a){
    char[] array = String.valueOf(a).toCharArray();
    for(char ca: array){
      if(ca == '3'){
        return true;
      }
    }
    return false;
  }
}
0