
https://ask.csdn.net/questions/7452756,题目变了了?写21题的?帮助到你可以点个采纳吗 ,谢谢~

using System;
using System.Collections.Generic;
namespace ConsoleApp1
{
class A
{
int x, y;
public A(int x,int y) { this.x = x;this.y = y; }
public void Show() { Console.WriteLine("{0},{1}", x, y); }
}
class Program
{
static void Main(string[] args)
{
List<A> list = new List<A>();
list.Add(new A(0, 0));
list.Add(new A(1, 1));
list.Add(new A(2, 2));
foreach (A a in list) a.Show();
Console.WriteLine("请按任意键继续...");
Console.ReadKey();
}
}
}