結果

問題 No.207 世界のなんとか
ユーザー ooh_21ooh_21
提出日時 2017-05-08 12:28:32
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 60 ms / 5,000 ms
コード長 1,096 bytes
コンパイル時間 2,123 ms
コンパイル使用メモリ 103,600 KB
実行使用メモリ 22,928 KB
最終ジャッジ日時 2023-10-12 18:52:56
合計ジャッジ時間 4,396 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
20,752 KB
testcase_01 AC 59 ms
20,732 KB
testcase_02 AC 60 ms
18,752 KB
testcase_03 AC 60 ms
22,916 KB
testcase_04 AC 59 ms
20,792 KB
testcase_05 AC 59 ms
20,824 KB
testcase_06 AC 58 ms
22,772 KB
testcase_07 AC 58 ms
20,652 KB
testcase_08 AC 58 ms
20,740 KB
testcase_09 AC 58 ms
20,832 KB
testcase_10 AC 59 ms
20,720 KB
testcase_11 AC 58 ms
20,840 KB
testcase_12 AC 59 ms
20,744 KB
testcase_13 AC 59 ms
20,828 KB
testcase_14 AC 59 ms
20,840 KB
testcase_15 AC 59 ms
20,888 KB
testcase_16 AC 59 ms
20,824 KB
testcase_17 AC 58 ms
22,928 KB
testcase_18 AC 57 ms
22,780 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 pj1
{
    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