結果

問題 No.207 世界のなんとか
ユーザー kenji_shioya
提出日時 2016-06-23 01:33:20
言語 Java
(openjdk 23)
結果
AC  
実行時間 150 ms / 5,000 ms
コード長 547 bytes
コンパイル時間 3,426 ms
コンパイル使用メモリ 74,840 KB
実行使用メモリ 49,664 KB
最終ジャッジ日時 2024-10-11 19:46:29
合計ジャッジ時間 6,872 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

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