結果

問題 No.207 世界のなんとか
ユーザー TatsuDXTatsuDX
提出日時 2016-09-09 00:37:33
言語 Java21
(openjdk 21)
結果
AC  
実行時間 122 ms / 5,000 ms
コード長 381 bytes
コンパイル時間 2,724 ms
コンパイル使用メモリ 75,968 KB
実行使用メモリ 54,316 KB
最終ジャッジ日時 2024-04-27 18:21:49
合計ジャッジ時間 5,559 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 107 ms
53,120 KB
testcase_01 AC 122 ms
53,952 KB
testcase_02 AC 119 ms
53,832 KB
testcase_03 AC 112 ms
52,756 KB
testcase_04 AC 119 ms
53,860 KB
testcase_05 AC 104 ms
53,100 KB
testcase_06 AC 111 ms
53,932 KB
testcase_07 AC 108 ms
53,724 KB
testcase_08 AC 105 ms
53,996 KB
testcase_09 AC 112 ms
53,840 KB
testcase_10 AC 115 ms
54,316 KB
testcase_11 AC 112 ms
54,092 KB
testcase_12 AC 104 ms
53,164 KB
testcase_13 AC 116 ms
53,968 KB
testcase_14 AC 110 ms
53,860 KB
testcase_15 AC 104 ms
53,060 KB
testcase_16 AC 110 ms
54,172 KB
testcase_17 AC 105 ms
53,720 KB
testcase_18 AC 116 ms
54,268 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Test {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int a = sc.nextInt(), b = sc.nextInt(), t, s;
		for(int i = a; i <= b; i++){
			s = 0;
			t = i;
			while(t > 0){
				if(t%10 == 3){
					break;
				}
				s += t%10;
				t/=10;
			}
			if(t > 0 || s % 3 == 0){
				System.out.println(i);
			}
		}
	}
}
0