結果

問題 No.207 世界のなんとか
ユーザー chankou0920
提出日時 2017-09-25 12:31:58
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 26 ms / 5,000 ms
コード長 497 bytes
コンパイル時間 1,040 ms
コンパイル使用メモリ 109,568 KB
実行使用メモリ 26,128 KB
最終ジャッジ日時 2024-11-14 13:17:48
合計ジャッジ時間 2,165 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

public class Test {
	public static bool isOk (long value) {
		if (value % 3 == 0) {
			return true;
		}
		while (value > 0) {
			if (value % 10 == 3) {
				return true;
			}
			value /= 10;
		}
		return false;
	}
	
	public static void Main(string[] args) {
		string[] nums = Console.ReadLine().Split(' ');
		long min = long.Parse(nums[0]);  // min >= 1
		long max = long.Parse(nums[1]);
		for (long i = min; i <= max; i++) {
			if (isOk(i)) {
				Console.WriteLine(i);
			}
		}
	}
}
0