program GalaktickaII;

{$APPTYPE CONSOLE}

uses
  SysUtils, math;
var h, dh, ro, g, T, R, p,Mobject, Rsurf, kapa, c, cp, cv, mmol: real;

begin
R:=8.31;
h:=0;
mmol:=0.029;
dh:=10;
T:=300;
p:=101325;
Rsurf:=6378000;
Mobject:=5.9742E24;
cp:=1.01;
cv:=0.72;
kapa:=cp/cv;
c:=p*power((R*T/p),kapa);

repeat
begin
g:=6.67E-11*Mobject/((Rsurf+h)*(Rsurf+h));
ro:=mmol*p/(R*T);
p:=p-(dh*ro*g);
T:=c*(power(p,kapa-1))*(power(R,-kapa));
h:=h+dh;
writeln('h=',h,'	','T=',T,'	','p=',p,'	','ro=',ro,'	','g=',g);
end;
until p<1;
end.
// C:\GalaktickaII.exe>GalaktickaII.txt
