結果

問題 No.405 ローマ数字の腕時計
ユーザー claw88
提出日時 2016-08-05 22:43:56
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 23 ms / 2,000 ms
コード長 2,429 bytes
コンパイル時間 703 ms
コンパイル使用メモリ 108,728 KB
実行使用メモリ 18,048 KB
最終ジャッジ日時 2024-07-06 18:59:51
合計ジャッジ時間 1,991 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 27
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 yuki_405
{
    class Program
    {
        static void Main(string[] args)
        {
            int ans = 0;
            var a = scan();
            String k = a[0];
            int t = int.Parse(a[1]);
            string[] b = new string[13];
            b[ans] = a[0];
            b[0] = "XII";
            b[1] = "I";
            b[2] = "II";
            b[3] = "III";
            b[4] = "IIII";
            b[5] = "V";
            b[6] = "VI";
            b[7] = "VII";
            b[8] = "VIII";
            b[9] = "IX";
            b[10] = "X";
            b[11] = "XI";

            if (a[0]=="I")
            {
                ans = 1;
                b[ans] = a[0];
            }
            else if (a[0]=="II")
            {
                ans = 2; b[ans] = a[0];
            }
            else if (a[0]=="III")
                
            {
                ans = 3; b[ans] = a[0];
            }
            else if (a[0]=="IIII")
            {
                ans = 4; b[ans] = a[0];
            }
            else if (a[0]=="V")
            {
                ans = 5; b[ans] = a[0];
            }
            else if (a[0]=="VI")
            {
                ans = 6; b[ans] = a[0];
            }
            else if (k=="VII")
            {
                ans = 7; b[ans] = a[0];
            }
            else if (k == "VIII") {
                ans = 8; b[ans] = a[0];
            }
            else if (k=="IX")
            {
                ans = 9; b[ans] = a[0];
            }
            else if (k=="X")
            {
                ans = 10; b[ans] = a[0];
            }
            else if (k=="XI")
            {
                ans = 11; b[ans] = a[0];
            }
            if (t>=0)
            {
                ans += t;
                //Console.WriteLine(ans);
                ans %= 12;
                //Console.WriteLine(ans);
                Console.WriteLine(b[ans]);
            }
            else
            {
                int z = -1 * t;
                z %= 12;
                z = 12 - z;
                ans += z;
                ans %= 12;
                Console.WriteLine(b[ans]);
            }
           
        }
        static string[] scan()
        {
            return

                Console.ReadLine().Split(' ');
        }
    }
}
0