Forum www.ispwsznysa.fora.pl Strona Główna www.ispwsznysa.fora.pl
Informatyka Stosowania PWSZ NYSA
 
 FAQFAQ   SzukajSzukaj   UżytkownicyUżytkownicy   GrupyGrupy   GalerieGalerie   RejestracjaRejestracja 
 ProfilProfil   Zaloguj się, by sprawdzić wiadomościZaloguj się, by sprawdzić wiadomości   ZalogujZaloguj 

Bonusy Halikowski

 
Napisz nowy temat   Odpowiedz do tematu    Forum www.ispwsznysa.fora.pl Strona Główna -> Programowania I
Zobacz poprzedni temat :: Zobacz następny temat  
Autor Wiadomość
Mardok
Gaduła



Dołączył: 09 Gru 2007
Posty: 91
Przeczytał: 0 tematów


PostWysłany: Nie 20:52, 09 Gru 2007    Temat postu: Bonusy Halikowski

program Bryla;

{$APPTYPE CONSOLE}

uses
SysUtils;

var
i,j,n : integer;

begin
write('Podaj N : ');
readln(n);

for i:=1 to 12-n do writeln;

for i:=1 to n do
begin

for j:=1 to 40-n do write(' ');

for j:=1 to n do
begin
if (i+j = n+1) then write('#')
else write(' ');
end;

for j:=1 to n do
begin
if (i = 1) or (i+j = n+1) or (j = n) then write('#')
else write(' ');
end;
writeln;
end;

for i:=1 to n do
begin

for j:=1 to 40-n do write(' ');

for j:=1 to n do
begin
if (i = 1) or (j = 1) or (j = n) or (i = n) then write('#')
else write(' ');
end;

for j:=1 to n do
begin
if (i+j = n+1) then write('#')
else write(' ');
end;

writeln;
end;

readln;
end.
Powrót do góry
Zobacz profil autora
Zobacz poprzedni temat :: Zobacz następny temat  
Autor Wiadomość
Mardok
Gaduła



Dołączył: 09 Gru 2007
Posty: 91
Przeczytał: 0 tematów


PostWysłany: Nie 20:52, 09 Gru 2007    Temat postu:

program Choinka;

{$APPTYPE CONSOLE}

uses
SysUtils;

var
z,n,i,j,los : integer;

begin
randomize;

write('Podaj N : ');
readln(n);

writeln;

for z:=1 to 3 do
begin

for i:=1 to n do
begin
for j:=1 to n-i+(3-z)+2 do write(' ');

for j:=1 to i*2 do
if (j = 1) or (j = i*2) or (i = n) then write('#')
else begin
los:=random(3);
if los = 1 then write('0')
else write(' ');
end;

writeln;
end;

Inc(n);

if z = 3 then
for i:=1 to 3 do
begin
for j:=1 to n do write(' ');
writeln('##');
end;

end;

readln;
end.
Powrót do góry
Zobacz profil autora
Zobacz poprzedni temat :: Zobacz następny temat  
Autor Wiadomość
Mardok
Gaduła



Dołączył: 09 Gru 2007
Posty: 91
Przeczytał: 0 tematów


PostWysłany: Nie 20:53, 09 Gru 2007    Temat postu:

program Choinka2;

{$APPTYPE CONSOLE}

uses
SysUtils;

var
z,n,i,j,los : integer;

begin
randomize;

write('Podaj N : ');
readln(n);

writeln;

for z:=1 to 4 do
begin

for i:=1 to n do
begin
for j:=1 to n-i+(3-z)+2 do write(' ');

for j:=1 to i*2 do
if z = 4 then
begin

if ((j = i) or (j-1 = i)) and (i < 4) then write('#')
else write(' ');

end else
if (j = 1) or (j = i*2) or (i = n) then write('#')
else begin
los:=random(3);
if los = 1 then write('0')
else write(' ');
end;

if z > 1 then
begin

for j:=1 to n*2-i*2+4+(6-z*2) do write(' ');

for j:=1 to i*2 do
if (j = 1) or (j = i*2) or (i = n) then write('#')
else begin
los:=random(3);
if los = 1 then write('0')
else write(' ');
end;

end;

writeln;
end;

Inc(n);

if z = 4 then
for i:=1 to 3 do
begin
for j:=1 to n*3-1 do write(' ');
writeln('##');
end;

end;

readln;
end.
Powrót do góry
Zobacz profil autora
Zobacz poprzedni temat :: Zobacz następny temat  
Autor Wiadomość
Mardok
Gaduła



Dołączył: 09 Gru 2007
Posty: 91
Przeczytał: 0 tematów


PostWysłany: Nie 20:53, 09 Gru 2007    Temat postu:

program Choinka3;

{$APPTYPE CONSOLE}

uses
SysUtils;

var
z,n,i,j : integer;
los,bom : byte;
bombki : array[1..5] of char = ('0','+','%','$','@');

begin
randomize;

write('Podaj N : ');
readln(n);

writeln;

for z:=1 to 3 do
begin

if z = 1 then
begin
for j:=1 to n+3 do write(' ');
writeln('/\');
for j:=1 to n+2 do write(' ');
writeln('(**)');
for j:=1 to n+3 do write(' ');
writeln('||');
end;

for i:=1 to n do
begin

for j:=1 to n-i+(3-z)+2 do
begin

if ((z mod 2) = 1) and ((i mod 2) <> (n mod 2)) and (j = n-i+(3-z)+2) and (i <> 1) then write('|')
else if ((z mod 2) = 0) and ((i mod 2) <> (n mod 2)) and (j = n-i+(3-z)+2) and (i <> 1) then write('|')
else if ((z mod 2) = 1) and ((i mod 2) = (n mod 2)) and (j = n-i+(3-z)+1) and (i <> n) then write('+')
else if ((z mod 2) = 0) and ((i mod 2) = (n mod 2)) and (j = n-i+(3-z)+1) and (i <> n) then write('+')
else write(' ');

end;

for j:=1 to i*2 do
if (j = 1) or (j = i*2) or (i = n) then write('#')
else begin
los:=random(3);
bom:=random(5)+1;
if los = 1 then write(bombki[bom])
else write(' ');
end;

if ((z mod 2) = 1) and ((i mod 2) <> (n mod 2)) and (i <> 1) then write('|')
else if ((z mod 2) = 0) and ((i mod 2) <> (n mod 2)) and (i <> 1) then write('|')
else if ((z mod 2) = 1) and ((i mod 2) = (n mod 2)) and (i <> n) then write(' +')
else if ((z mod 2) = 0) and ((i mod 2) = (n mod 2)) and (i <> n) then write(' +');

writeln;
end;

Inc(n);

if z = 3 then
for i:=1 to 3 do
begin
for j:=1 to n do write(' ');
writeln('##');
end;

end;

readln;
end.
Powrót do góry
Zobacz profil autora
Zobacz poprzedni temat :: Zobacz następny temat  
Autor Wiadomość
Mardok
Gaduła



Dołączył: 09 Gru 2007
Posty: 91
Przeczytał: 0 tematów


PostWysłany: Nie 20:53, 09 Gru 2007    Temat postu:

program Choinka4;

{$APPTYPE CONSOLE}

uses
SysUtils;

var
z,x,n,i,j,los : integer;

begin
randomize;

write('Podaj N : ');
readln(n);

writeln;

for z:=1 to 3 do
begin

for i:=1 to n do
begin

for x:=1 to 3 do
begin

if x = 1 then
for j:=1 to n-i+(3-z)+2 do write(' ');

for j:=1 to i*2 do
if (j = 1) or (j = i*2) or (i = n) then write('#')
else begin
los:=random(3);
if los = 1 then write('0')
else write(' ');
end;

if (x = 1) or (x = 2) then
for j:=1 to n*2-i*2+(6-z*2)+4 do write(' ');

end;

writeln;
end;

Inc(n);

if z = 3 then
for i:=1 to 3 do
begin
for j:=1 to n do write(' ');
write('##');
for j:=1 to n*2 do write(' ');
write('##');
for j:=1 to n*2 do write(' ');
write('##');
writeln;
end;

end;

readln;
end.
Powrót do góry
Zobacz profil autora
Zobacz poprzedni temat :: Zobacz następny temat  
Autor Wiadomość
Mardok
Gaduła



Dołączył: 09 Gru 2007
Posty: 91
Przeczytał: 0 tematów


PostWysłany: Nie 20:53, 09 Gru 2007    Temat postu:

program FunTab;

{$APPTYPE CONSOLE}

uses
SysUtils;

var
n,i,j : integer;
o1,o2 : boolean;
tab : array[1..20,1..20] of integer;

begin
write('Podaj N : ');
readln(n);
writeln;

for i:=1 to n*2 do
begin

o1:=false;
o2:=false;

for j:=1 to n*2 do
begin

if (i <= n) and (j <= n) then
begin
if i = j then o1:=true;
if o1 then tab[i,j]:=n-i+1
else tab[i,j]:=n-j+1;
end;

if (i <= n) and (j > n) then
begin
if n-i+1 = j-n then o2:=true;
if o2 then tab[i,j]:=j-n
else tab[i,j]:=n-i+1;
end;

if (i > n) and (j <= n) then
begin
if n-j+1 = i-n then o1:=true;
if o1 then tab[i,j]:=i-n
else tab[i,j]:=n-j+1;
end;

if (i > n) and (j > n) then
begin
if i = j then o2:=true;
if o2 then tab[i,j]:=j-n
else tab[i,j]:=i-n;
end;

end;

end;

for i:=1 to n*2 do
begin
for j:=1 to n*2 do write(tab[i,j]:2);
writeln;
end;

readln;
end.
Powrót do góry
Zobacz profil autora
Zobacz poprzedni temat :: Zobacz następny temat  
Autor Wiadomość
Mardok
Gaduła



Dołączył: 09 Gru 2007
Posty: 91
Przeczytał: 0 tematów


PostWysłany: Nie 20:54, 09 Gru 2007    Temat postu:

program Kwadraty;

{$APPTYPE CONSOLE}

uses
SysUtils;

var
i,j,z,n : integer;

begin
write('Podaj N : ');
readln(n);
writeln;

for i:=1 to n do
begin

for z:=1 to i do
begin

for j:=1 to n-z+1 do write('#');
write(' ');

end;

writeln;

end;

readln;
end.
Powrót do góry
Zobacz profil autora
Zobacz poprzedni temat :: Zobacz następny temat  
Autor Wiadomość
Mardok
Gaduła



Dołączył: 09 Gru 2007
Posty: 91
Przeczytał: 0 tematów


PostWysłany: Nie 20:54, 09 Gru 2007    Temat postu:

program ReplaceString;

{$APPTYPE CONSOLE}

uses
SysUtils;

function RepStr(dest,str,rep : string) : string;
var
i,j,z : integer;
s,s2 : string;
ok : boolean;
begin
s2:='';
z:=0;
ok:=false;

for i:=1 to Length(dest) do
begin

s:='';
for j:=1 to Length(str) do
s:=s + dest[j+i-1];

if (s = str) and (ok = false) then ok:=true;

if ok then
begin
inc(z);
if z = length(str) then
begin
ok:=false;
s2:=s2 + rep;
z:=0;
end;

end
else s2:=s2 + dest[i];

end;
result:=s2;
end;

begin
writeln(RepStr('uDupa jasiu pierdzi stasiu aaau','u','[___]'));
writeln(RepStr('uDupa jasiu pierdzi stasiu aaau','u','U'));
writeln(RepStr('uDupa jasiu pierdzi stasiu aaau','i','/\'));
readln;
end.
Powrót do góry
Zobacz profil autora
Zobacz poprzedni temat :: Zobacz następny temat  
Autor Wiadomość
Mardok
Gaduła



Dołączył: 09 Gru 2007
Posty: 91
Przeczytał: 0 tematów


PostWysłany: Nie 20:54, 09 Gru 2007    Temat postu:

program Slimak;

{$APPTYPE CONSOLE}

uses
SysUtils;

var
i,j,n : integer;

begin
write('Podaj N : ');
readln(n);
writeln;

for i:=1 to n do
begin
for j:=1 to n do
begin

if (i = j) and (i > (n div 2) + (n mod 2)) then write(chr(217))
else
if (i + j = n + 1) and (i > (n div 2)+1) then write(chr(192))
else
if (i + j = n + 1) and (i < (n div 2)+1) then write(chr(191))
else
if (i - 1 = j) and (i <= (n div 2) + (n mod 2)) then write(chr(218))
else
if ((i > j) and (i+j < n+1)) or ((i < j) and (i+j > n+1)) then write('|')
else write('-')

end;
writeln;
end;

readln;
end.
Powrót do góry
Zobacz profil autora
Zobacz poprzedni temat :: Zobacz następny temat  
Autor Wiadomość
stramik
Administrator



Dołączył: 02 Gru 2007
Posty: 126
Przeczytał: 0 tematów

Skąd: Grodków

PostWysłany: Nie 21:19, 09 Gru 2007    Temat postu:

Ale bonusow podrzuciles Smile
Powrót do góry
Zobacz profil autora
Zobacz poprzedni temat :: Zobacz następny temat  
Autor Wiadomość
Mardok
Gaduła



Dołączył: 09 Gru 2007
Posty: 91
Przeczytał: 0 tematów


PostWysłany: Nie 21:37, 09 Gru 2007    Temat postu:

stramik napisał:
Ale bonusow podrzuciles Smile


Nie moja wina że tyle mi kazał na laborkach robić Wink
Powrót do góry
Zobacz profil autora
Wyświetl posty z ostatnich:   
Napisz nowy temat   Odpowiedz do tematu    Forum www.ispwsznysa.fora.pl Strona Główna -> Programowania I Wszystkie czasy w strefie CET (Europa)
Strona 1 z 1

 
Skocz do:  
Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach

fora.pl - załóż własne forum dyskusyjne za darmo
Powered by phpBB © 2001, 2005 phpBB Group
Regulamin