結果

問題 No.207 世界のなんとか
ユーザー kenji_shioyakenji_shioya
提出日時 2016-06-23 01:32:09
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 546 bytes
コンパイル時間 3,093 ms
コンパイル使用メモリ 76,020 KB
実行使用メモリ 55,968 KB
最終ジャッジ日時 2024-04-20 00:58:02
合計ジャッジ時間 6,147 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 123 ms
54,096 KB
testcase_04 AC 107 ms
53,076 KB
testcase_05 WA -
testcase_06 AC 114 ms
54,176 KB
testcase_07 AC 115 ms
53,992 KB
testcase_08 AC 118 ms
54,032 KB
testcase_09 AC 107 ms
53,196 KB
testcase_10 WA -
testcase_11 AC 120 ms
53,980 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 136 ms
53,912 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 115 ms
54,172 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