結果
問題 |
No.207 世界のなんとか
|
ユーザー |
![]() |
提出日時 | 2016-05-05 14:33:56 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 139 ms / 5,000 ms |
コード長 | 500 bytes |
コンパイル時間 | 2,498 ms |
コンパイル使用メモリ | 75,448 KB |
実行使用メモリ | 54,476 KB |
最終ジャッジ日時 | 2024-10-09 10:52:14 |
合計ジャッジ時間 | 5,823 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 19 |
ソースコード
import java.util.Scanner; public class Main{ static boolean f(long x){ if(x%3==0) return true; else{ String str=Long.toString(x); for(int i=0;i<str.length();i++){ if(str.charAt(i)=='3') return true; } return false; } } public static void main(String[] args){ Scanner sc=new Scanner(System.in); while(sc.hasNext()){ long a=sc.nextLong(); long b=sc.nextLong(); for(long i=a;i<=b;i++) if(f(i)) System.out.println(i); } } }