[Offer收割]编程练习赛54 register

Ended

Participants:154

Verdict:Runtime Error
Score:0 / 100
Submitted:2018-04-08 13:15:08

Lang:C#

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
    #region IO Class
    /// <summary> IO Class </summary>
    public class IOClass
    {
        private readonly string[] array;
        private int f;
        public IOClass(string chs = "\r\n ")
        {
#if DeskTopText
            string content = System.IO.File.ReadAllText(@"C:\Users\" + Environment.UserName + @"\Desktop\hi.txt");
#else
            string content = Console.In.ReadToEnd();
#endif
            if (string.IsNullOrEmpty(chs)) array = new string[] { content };
            else array = content.Split(chs.ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
        }
        public double Lf { get { if (f < array.Length) return double.Parse(array[f++]); else return 0; } }
        public int D { get { if (f < array.Length) return int.Parse(array[f++]); else return 0; } }
        public long Ld { get { if (f < array.Length) return long.Parse(array[f++]); else return 0; } }
        public string S { get { if (f < array.Length) return array[f++]; else return ""; } }
        public bool OK { get { return f < array.Length; } }
        internal StringBuilder b = new StringBuilder();
        public void Dispose() { Console.Write(b.ToString()); b.Clear(); }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX