2010/04/02
C# week10_3
31/03/2010
Arraylist in Arraylist
namespace ConsoleApplication9
{
class Program
{
static void Main(string[] args)
{
ArrayList row1 = new ArrayList();
row1.Add("* * ****** * * *** ");
ArrayList row2 = new ArrayList();
row2.Add("* * * * * * * ");
ArrayList row3 = new ArrayList();
row3.Add("****** ****** * * * *");
ArrayList row4 = new ArrayList();
row4.Add("* * * * * * * ");
ArrayList row5 = new ArrayList();
row5.Add("* * ****** ****** ****** *** ");
ArrayList al = new ArrayList();
al.Add(row1);
al.Add(row2);
al.Add(row3);
al.Add(row4);
al.Add(row5);
foreach (ArrayList a in al)
{
IEnumerator ie = a.GetEnumerator();
while (ie.MoveNext())
{
Console.WriteLine(ie.Current.ToString());
}
}
}
}
}
Output
HELLO
One of my class mates wrote "HELL":)
登録:
コメントの投稿 (Atom)
0 件のコメント:
コメントを投稿