program.cs

来自「将数字时间转换为英语口语表达形式」· CS 代码 · 共 48 行

CS
48
字号
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;

namespace TimeConvert
{
    class Program
    {
        static StringCollection times = new StringCollection();

        static void Main(string[] args)
        {
            string command = "";

            do
            {
                command = Console.ReadLine();
                string[] numbers = command.Split(new char[] { ' ' });

                try
                {
                    string word = TimeConverter.Convert(Int32.Parse(numbers[0]), Int32.Parse(numbers[1]));

                    if (word != "It is the end!")
                    {
                        times.Add(word);
                    }
                }
                catch
                {
                    Console.WriteLine("Invalid input!");
                    break;
                }
            }
            while (command != "0 0");

            foreach (string s in times)
            {
                Console.WriteLine(s);
            }
            Console.Read();
        }
    }


}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?