示例#1
0
 public void input()
 {
     int num = 0;
     string year = "", month = "", day = "";
     Console.WriteLine("input year/month/day, content, money");
     string date = Console.ReadLine();
     foreach (var item in date)
     {
         if (item == '/')
         {
             num += 1;
             continue;
         }
         if (num == 0)
         {
             year += item;
         }
         else if (num == 1)
         {
             month += item;
         }
         else if (num == 2)
         {
             day += item;
         }
     }
     int intyear = Int32.Parse(year);
     int intmonth = Int32.Parse(month);
     int intday = Int32.Parse(day);
     string content = Console.ReadLine();
     int intmoney = Int32.Parse(Console.ReadLine());
     total += intmoney;
     inform Inform = new inform(intyear, intmonth, intday, content, intmoney, total);
     list.Add(Inform);
 }
示例#2
0
        public void input()
        {
            int    num = 0;
            string year = "", month = "", day = "";

            Console.WriteLine("input year/month/day, content, money");
            string date = Console.ReadLine();

            foreach (var item in date)
            {
                if (item == '/')
                {
                    num += 1;
                    continue;
                }
                if (num == 0)
                {
                    year += item;
                }
                else if (num == 1)
                {
                    month += item;
                }
                else if (num == 2)
                {
                    day += item;
                }
            }
            int    intyear  = Int32.Parse(year);
            int    intmonth = Int32.Parse(month);
            int    intday   = Int32.Parse(day);
            string content  = Console.ReadLine();
            int    intmoney = Int32.Parse(Console.ReadLine());

            total += intmoney;
            inform Inform = new inform(intyear, intmonth, intday, content, intmoney, total);

            list.Add(Inform);
        }