Gdzie jest bład - proste pomóżcie jestem początkujący!!
Oto kod - nie wiem jak wywołać funkcję rusyj po podaniu wysokości h - błedy wywala w dwoch ostatnich linijkach przy nawiasie rysuj(h). Pomóżcie prosze:
using System;
using System.Collections.Generic;
using System.Text;
namespace MojaPrzestrzen
{
namespace PrzestrzenTrojkatow
{
public class Trojkat
{
void rysuj(int h)
{
int k, w, p, a;
a = 1;
p = 1;
k = 1;
w = 1;
Console.Write("\n\n\t\t\t\t\t");
do
{
while (k < a) { Console.Write("\b"); k++; }
while (p < k) { Console.Write("###\b"); p++; }
if (k == w) { Console.Write("#\n\t\t\t\t\t"); k = 1; p = 1; w++; a++; }
} while (w <= h);
Console.ReadKey();
}
}
}
namespace PrzestrzenKwadratow
{
public class Kwadrat
{
void rysuj(int h)
{
int b, c;
b = 1;
c = 1;
Console.Write("\n\n\t\t\t\t\t");
do
{
while (b < h) { Console.Write("#"); b++; }
if (b == h) { Console.Write("\n\t\t\t\t\t"); b = 1; c++; }
} while (c <= h);
Console.ReadKey();
}
}
}
class Program
{
static void Main(string[] args)
{
int h;
Console.WriteLine("Podaj wysokosc trojkat a zarazem i kwadratu h = ");
h = Convert.ToInt32(Console.ReadLine());
MojaPrzestrzen.PrzestrzenTrojkatow.Trojkat.rysuj(h);
MojaPrzestrzen.PrzestrzenKwadratow.Kwadrat.rysuj(h);
Console.ReadKey();
}
}
}