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]);
}
}
}
}
}
}
|
|