結果

問題 No.207 世界のなんとか
ユーザー TwinkleStar74TwinkleStar74
提出日時 2017-09-12 01:07:36
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 516 bytes
コンパイル時間 4,242 ms
コンパイル使用メモリ 75,156 KB
実行使用メモリ 41,600 KB
最終ジャッジ日時 2024-04-25 05:54:02
合計ジャッジ時間 6,749 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
40,188 KB
testcase_01 AC 121 ms
41,088 KB
testcase_02 AC 131 ms
41,080 KB
testcase_03 AC 125 ms
41,164 KB
testcase_04 AC 125 ms
41,412 KB
testcase_05 AC 120 ms
40,460 KB
testcase_06 AC 124 ms
40,908 KB
testcase_07 AC 122 ms
41,204 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 114 ms
39,980 KB
testcase_12 AC 118 ms
40,808 KB
testcase_13 WA -
testcase_14 AC 138 ms
41,212 KB
testcase_15 AC 130 ms
41,092 KB
testcase_16 AC 124 ms
40,968 KB
testcase_17 AC 125 ms
41,104 KB
testcase_18 AC 113 ms
39,936 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class No_207 {
	
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		int a = sc.nextInt();
		int b = sc.nextInt();
		
		for(int i = a; i<=b; i++){  //aからbまで回す
			if (i%3==0) { System.out.println(i); }
			
			else if(i%3!=0){
				
        	String k = String.valueOf(i);  //数字iを文字列kに変換
        	if (k.indexOf("3")>0){ System.out.println(i); } //文字列kに3が入っていればiを出力

			}
			
        }

	}
	
}
0