結果

問題 No.207 世界のなんとか
ユーザー ooh_23ooh_23
提出日時 2017-05-08 12:38:11
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 57 ms / 5,000 ms
コード長 1,115 bytes
コンパイル時間 2,106 ms
コンパイル使用メモリ 105,700 KB
実行使用メモリ 22,868 KB
最終ジャッジ日時 2023-10-12 18:53:27
合計ジャッジ時間 4,082 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
20,700 KB
testcase_01 AC 56 ms
20,928 KB
testcase_02 AC 56 ms
20,816 KB
testcase_03 AC 57 ms
20,788 KB
testcase_04 AC 57 ms
22,784 KB
testcase_05 AC 56 ms
20,808 KB
testcase_06 AC 56 ms
20,776 KB
testcase_07 AC 56 ms
20,720 KB
testcase_08 AC 57 ms
22,868 KB
testcase_09 AC 57 ms
22,672 KB
testcase_10 AC 56 ms
18,824 KB
testcase_11 AC 56 ms
20,748 KB
testcase_12 AC 57 ms
20,732 KB
testcase_13 AC 56 ms
20,744 KB
testcase_14 AC 57 ms
22,720 KB
testcase_15 AC 56 ms
20,736 KB
testcase_16 AC 56 ms
20,808 KB
testcase_17 AC 56 ms
20,680 KB
testcase_18 AC 55 ms
22,788 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace lecture
{
    class Program
    {
        bool hasThree(int value)
        {
            string str = value.ToString();
            for (int i = 0; i < str.Length; i++)
            {
                if (str[i] == '3')
                {
                    return true;
                }
            }
            return false;
        }
        
        bool check(int value)
        {
            if (value % 3 == 0 || hasThree(value))
            {
                return true;
            }
            return false;
        }

        static void Main(string[] args)
        {
            Program program = new Program();
            string[] row = Console.ReadLine().Split();
            int A = int.Parse(row[0]);
            int B = int.Parse(row[1]);


            for (int number = A; number <= B; number++)
            {
                if (program.check(number))
                {
                    Console.WriteLine(number);
                }
            }
        }
    }
}
0