A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

 找回密码
 加入黑马

QQ登录

只需一步,快速开始

© 班顶超 中级黑马   /  2012-5-21 17:47  /  1592 人查看  /  1 人回复  /   0 人收藏 转载请遵从CC协议 禁止商业使用本文

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
注:首先得要引用using System.Collections
namespace  Text01{
    class Program
    {
        static void Main(string[] args)
        {
            ArrayList arr = new ArrayList();
            string str;
            while (true)
            {
                Console.WriteLine("\n");
                Console.WriteLine("请输入一个字符,结束请输入'end'");
                str = Console.ReaddLine();
                if (str == "end")
                {
                    break;
                }
                else
                {
                    arr.Add(str);
                    Console.WriteLine();
                    for (int i = 0; i < arr.Count; i++)
                    {
                        Console.Write("{0}", arr[i]);
                    }
                }
            }

        }
    }
}

1 个回复

倒序浏览
程序中Console.ReadLine();写的有些问题,多了个d,需要删除了才能够运行
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 加入黑马