結果
| 問題 | 
                            No.207 世界のなんとか
                             | 
                    
| コンテスト | |
| ユーザー | 
                             kenji_shioya
                         | 
                    
| 提出日時 | 2016-06-23 01:33:48 | 
| 言語 | Java  (openjdk 23)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 138 ms / 5,000 ms | 
| コード長 | 547 bytes | 
| コンパイル時間 | 3,370 ms | 
| コンパイル使用メモリ | 74,300 KB | 
| 実行使用メモリ | 41,536 KB | 
| 最終ジャッジ日時 | 2024-10-11 19:47:12 | 
| 合計ジャッジ時間 | 6,651 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 19 | 
ソースコード
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;
  }
}
            
            
            
        
            
kenji_shioya