Moderator: xxSlayeRxx
namespace zad2
{
public class Point
{
public int X { get; set; }
public int Y { get; set; }
public Point(int x, int y)
{
this.X = x;
this.Y = y;
}
public string ToString()
{
return X + "," + Y;
}
}
public class ArrayListTest
{
public static void Main(string[] args)
{
ArrayList AL = new ArrayList();
Random R = new Random();
for (int i = 0; i < 10; i++)
{
Point p = new Point(R.Next(50), R.Next(50));
AL.Add(p);
}
PrintValues(AL);
AL.Sort();
PrintValues(AL);
}
public static void PrintValues(IEnumerable AL)
{
foreach (Object obj in AL)
Console.WriteLine(" {0}", obj);
Console.WriteLine();
Console.Read();
}
}
}
Użytkownicy przeglądający ten dział: Brak zidentyfikowanych użytkowników i 15 gości