結果

問題 No.207 世界のなんとか
ユーザー ooh_17ooh_17
提出日時 2017-05-08 12:31:40
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 60 ms / 5,000 ms
コード長 1,058 bytes
コンパイル時間 2,995 ms
コンパイル使用メモリ 107,420 KB
実行使用メモリ 22,972 KB
最終ジャッジ日時 2023-10-12 18:53:18
合計ジャッジ時間 4,333 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
20,688 KB
testcase_01 AC 59 ms
20,796 KB
testcase_02 AC 59 ms
20,932 KB
testcase_03 AC 59 ms
20,732 KB
testcase_04 AC 59 ms
20,828 KB
testcase_05 AC 60 ms
20,816 KB
testcase_06 AC 59 ms
22,856 KB
testcase_07 AC 58 ms
20,828 KB
testcase_08 AC 59 ms
20,864 KB
testcase_09 AC 59 ms
20,708 KB
testcase_10 AC 59 ms
22,704 KB
testcase_11 AC 59 ms
22,780 KB
testcase_12 AC 58 ms
20,772 KB
testcase_13 AC 59 ms
20,804 KB
testcase_14 AC 59 ms
22,972 KB
testcase_15 AC 59 ms
20,928 KB
testcase_16 AC 58 ms
20,804 KB
testcase_17 AC 60 ms
20,808 KB
testcase_18 AC 57 ms
22,768 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