51 lines
1.3 KiB
C#
51 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace ConsoleApp1
|
|
{
|
|
public class Alak
|
|
{
|
|
public virtual void Rajzol() {
|
|
Console.WriteLine("Alakzat rajzolása.");
|
|
}
|
|
}
|
|
|
|
public class Kor : Alak
|
|
{
|
|
public override void Rajzol()
|
|
{
|
|
Console.WriteLine("Kör rajzolása.");
|
|
}
|
|
}
|
|
|
|
public class Kocka : Alak
|
|
{
|
|
public override void Rajzol()
|
|
{
|
|
Console.WriteLine("Téglalap rajzolása.");
|
|
|
|
Console.WriteLine(" .+------+ +------+ ");
|
|
Console.WriteLine(" .' | .' | /| /| ");
|
|
Console.WriteLine("+---+--+' | +-+----+ | ");
|
|
Console.WriteLine("| | | | | | | | ");
|
|
Console.WriteLine("| ,+--+---+ | +----+-+ ");
|
|
Console.WriteLine("|.' | .' |/ |/ ");
|
|
Console.WriteLine("+------+' +------+ ");
|
|
}
|
|
}
|
|
class Program
|
|
{
|
|
static void Main(string[] args)
|
|
{
|
|
Alak haromszog = new Alak();
|
|
haromszog.Rajzol();
|
|
Kocka teglalap = new Kocka();
|
|
teglalap.Rajzol();
|
|
Console.ReadLine();
|
|
}
|
|
}
|
|
}
|