Ver Mensaje Individual
  #9  
Antiguo 27-07-2010
darnnezt darnnezt is offline
Miembro
 
Registrado: jul 2010
Posts: 17
Reputación: 0
darnnezt Va por buen camino
De esta Manera queda muy corto

Código Delphi [-]
procedure TForm1.Button1Click(Sender: TObject);
var
pt,a,p,ah,prome1,prome2:real;
f,m,s:string;
hombre,c1,N:integer;

begin
a:=0;
p:=0;
m:='m';

pt:=0;
hombre:=0;
N:=0;

N:=strtoint(inputbox('IGRESE EL NUMERO DE PERSONAS',' N:',''));


for c1:=1 to n do
  begin
a:= strtofloat(inputbox('IGRESE LA ALTURA DE LA PERSONA M',' A:',''));
p:=strtofloat(inputbox('INGRESE EL PESO DE LA PERSONA KG ',' P:',''));

s:=string(inputbox('INGRSE EL SEXO DE LA PERSONA',' S:',''));


if (s = m) then
begin
hombre:=hombre+1;
ah:=ah+a;
end;

end;


pt:=pt+p;
prome1:= pt/n;
prome2:=ah/hombre;

Showmessage(' EL PESO DE LA POBLACION TOTAL '+FLOATTOSTR(prome1));
showmessage('EL PROMEDIO DE LA ALTURA DE LOS HOMBRE ES '+FLOATTOSTR(prome2));

Gracias a todos
Responder Con Cita