結果

問題 No.744 循環小数N桁目 Easy
ユーザー CroweaCrowea
提出日時 2019-01-21 12:46:59
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 64 ms / 2,000 ms
コード長 382 bytes
コンパイル時間 792 ms
コンパイル使用メモリ 63,260 KB
実行使用メモリ 24,800 KB
最終ジャッジ日時 2023-10-13 17:15:11
合計ジャッジ時間 2,207 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
24,788 KB
testcase_01 AC 62 ms
24,756 KB
testcase_02 AC 62 ms
22,768 KB
testcase_03 AC 63 ms
22,600 KB
testcase_04 AC 63 ms
24,700 KB
testcase_05 AC 62 ms
24,748 KB
testcase_06 AC 64 ms
22,648 KB
testcase_07 AC 62 ms
22,596 KB
testcase_08 AC 62 ms
24,800 KB
testcase_09 AC 62 ms
22,652 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using System;

class Program
{
    static void Main(string[] args)
    {
        var value = ((double)2 / (double)7).ToString().Split('.');
        string d = value[1];

        int idx = int.Parse(Console.ReadLine());
        if (idx <= 7) Console.WriteLine(d[idx - 1]);
        else
        {
            idx = idx % 6;
            Console.WriteLine(d[idx-1]);
        }
    }
}

0