All pastes #36666 Raw Edit

Untitled

public text v1 · immutable
#36666 ·published 2006-01-13 07:02 UTC
rendered paste body
program pacios_ivairiausios_Gerybes;

uses crt;

 procedure staciakampis (a, b : real; var P : real);
 begin
  P:= a * b;
end;

 procedure trikampis (c, h : real; var S : real);
 begin
  S:= 0.5 * c * h;
 end;

 function trapecija (q, w, u : real) : real;
 begin
 trapecija:= ((q + w) / 2) * u;
 end;

 function rombas (t, r : real) : real;
 begin
 rombas:= (t * r) / 2;
 end;

 procedure langas (x1, y1, x2, y2, sp : integer);
 begin
   window (x1, y1, x2, y2);
   textbackground(sp); clrscr
  end;

var a, b, P, c, h, S, q, w, u, t, r, trapecij, romb, staciak : real;

begin
 langas(2, 2, 50, 10, 2);
 writeln ('Iveskite staciakampio krastines:');
 read (a, b);
 staciakampis (a, b, P);
 //langas(2, 7, 30, 9, 5);
 writeln ('Staciakampio lotas: ' ,P :5:2);
 writeln ('Dabar iveskite trikampio krashtine ir aukstine:');
 read (c, h);
 trikampis (c, h, S);
 writeln ('Trikampio plotas: ' ,S :5:2);
 writeln('Iveskite trapecijos pagrindus ir aukstine:');
 read (q, w, u);
 trapecij := trapecija (q, w, u);
 writeln('Trapecijos plotas: ' ,trapecij:5:2);
 writeln('Iveskite rombo istrizaines:');
 read(t, r);
 romb := rombas(t,r);
 writeln('Rombo plotas: ',romb:5:2);
 Readln;
 readln;
end.