All pastes #196767 Raw Edit

Stuff

public text v1 · immutable
·published 2006-10-10 21:25 UTC
rendered paste body
program upe;
uses crt;   { naudojam papildomas bibliotekas}
var m, n, h : longint; x : real; y : real;

begin
  WriteLn('ivedam per valanda nuplaukta kelia myliom');
  readln(m);
  WriteLn('ivedam upes tekmes greiti');
  readln(n);
  WriteLn('ivedam laika');
  readln(h);
  if (m <= 0) or (n <= 0) or (h <= 0) then begin  {jei duoda nuli neskaiciuojam}
  writeln('Klaida duomenyse. Atsakymas negalimas');
  delay (2000);
  end
  else if (m>0) or (n>0) or (h>0) then begin
  x :=  (m - n)* h;
  y :=  (m+n)* h;
  end
  else if x = 0 then begin
    x :=  (m - n)* h;
  y :=  (m+n)* h;
  textcolor (15);
  writeln(' Upes tekmes greitis lygus valties greiciui valtis stovi vietoje.');
  WriteLn('Palei srove atstumas:' ,y:4:2, 'km');
  delay (2000);
  end
  else if (x<0) and (y<0)  then begin
    x :=  (m - n)* h;
  y :=  (m+n)* h;
  textcolor (14);
  WriteLn('Pries srove atstumas:' ,x:4:2, 'km');
  WriteLn('Palei srove atstumas:' ,y:4:2, 'km');
  delay (2000);   {palaikom kol pamato atsakyma}
  end

end.