Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.86 KB | None | 0 0
  1. program materi02b;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. uses
  6.   {$IFDEF UNIX}{$IFDEF UseCThreads}
  7.   cthreads,
  8.   {$ENDIF}{$ENDIF}
  9.   Classes, StrUtils, crt
  10.   { you can add units after this };
  11.  
  12. {$IFDEF WINDOWS}{$R materi02b.rc}{$ENDIF}
  13.  
  14. var x,y,z,n,n2,n3  : integer;
  15. begin
  16.   n := 18;
  17.   {// 3 looping
  18.   n2 := n div 2;
  19.   for x:=1 to n2 do begin
  20.     n3 := n-(x-1)*4;
  21.     for y:=1 to n3 do begin
  22.       for z:=1 to n3 do begin
  23.         gotoxy(x*2+y,x*2+z);
  24.         Write(IfThen((y=1)or(z=1)or(y=n3)or(z=n3),'*',' '));
  25.       end;
  26.     end;
  27.   end; }
  28.   // 2 looping
  29.   n2 := n div 3;
  30.   for x:=1 to n2 do begin
  31.     n3 := n-(x-1)*4;
  32.     for y:=1 to n3 do begin
  33.       gotoxy(x*2+y,x*2+1);  Write('*');
  34.       gotoxy(x*2+1,x*2+y);  Write('*');
  35.       gotoxy(x*2+y,x*2+n3); Write('*');
  36.       gotoxy(x*2+n3,x*2+y); Write('*');
  37.       end;
  38.     end;
  39.   readln;
  40.   // 1 looping: susah
  41. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement