結果
問題 |
No.207 世界のなんとか
|
ユーザー |
![]() |
提出日時 | 2018-05-20 11:47:23 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 138 ms / 5,000 ms |
コード長 | 620 bytes |
コンパイル時間 | 2,344 ms |
コンパイル使用メモリ | 73,772 KB |
実行使用メモリ | 41,808 KB |
最終ジャッジ日時 | 2024-06-28 14:36:03 |
合計ジャッジ時間 | 5,328 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 19 |
ソースコード
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int start=sc.nextInt(); int end=sc.nextInt(); for(int i=start;i<=end;i++) { if(isAho(i)) { System.out.println(i); } } sc.close(); } public static boolean isAho(int n) { if(n%3==0) { return true; } return containThree(n); } public static boolean containThree(int n) { while(n>0) { if(n%10==3) { return true; } n/=10; } return false; } }