using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace my
{
class Program
{
class Point: Shape
{
public Point(int x, int y)
: base(x, y)
{ }
public override void draw()
{
Console.WriteLine("Risovat v {0} {1}", x, y);
}
}
class reqtangle: Shape
{
public reqtangle(int x, int y, int w, int h):base(x,y)
{
}
public override void draw()
{
Console.WriteLine("Risovat v pryamougolnik v x={0} y={1} ", x, y);
}
}
class Shape
{
protected int x;
protected int y;
public Shape(int a, int b)
{
this.x = a;
this.y = b;
}
public virtual void draw()
{ }
}
class myclass
{
int x;
public myclass(int a)
{
this.x = a;
}
public int metod(myclass qwe)
{
return qwe.x+x;
}
}
struct myClass2
{
int a = 2;
int b = 3;
}
static void Main(string[] args)
{
Point a = new Point(1, 2);
a.draw();
reqtangle qwe = new reqtangle(1, 2, 3, 4);
qwe.draw();
Shape[] sh = new Shape[4];
sh[0] = new Point(3, 5);
sh[1] = new reqtangle(3, 4, 5, 6);
sh[2] = new Point(1, 2);
sh[3] = new reqtangle(1, 4, 2, 6);
foreach (Shape s in sh)
s.draw();
myclass rty = new myclass(2);
myclass rty1 = new myclass(3);
Console.WriteLine(rty.metod(rty1));
}
}
}