Jump to content
BulForum.com

Програма на Паскал


simbata

Recommended Posts

Da se sastavi programa, koqto vavejda informacia za n ot 1 do 130 jilishtni stroeji vav vida ime na arhitekt, adres, cena na sgradata . Programata da izvejda informacia za nai-evtinata sgrada i za neinia arhitekt.

 

Помощ, плс :bgrin:

Link to comment
Share on other sites

Ето едно просто решение:

 

program builder;

type
building = record
  archname, address : string;
  price : real;
end;

var n, c, max : byte; maxprice : real;
    bld : array[1..130] of building;

begin
write('N = '); readln(n);

for c := 1 to n do
begin
  writeln('Zapis: ', c);
  write('Ime  : '); readln(bld[c].archname);
  write('Adres: '); readln(bld[c].address);
  write('Cena : '); readln(bld[c].price);
end;

maxprice := bld[1].price;

for c := 2 to n do
begin
  if bld[c].price < maxprice then
  begin
     maxprice := bld[c].price;
     max := c;
  end;
end;

writeln;writeln('Informaciq za nai-evtinata sgrada:');
writeln(bld[max].archname);
writeln(bld[max].price:1:2);

readln;
end.

Link to comment
Share on other sites

Ето едно просто решение:

 

program builder;

type
building = record
  archname, address : string;
  price : real;
end;

var n, c, max : byte; maxprice : real;
    bld : array[1..130] of building;

begin
write('N = '); readln(n);

for c := 1 to n do
begin
  writeln('Zapis: ', c);
  write('Ime  : '); readln(bld[c].archname);
  write('Adres: '); readln(bld[c].address);
  write('Cena : '); readln(bld[c].price);
end;

maxprice := bld[1].price;

for c := 2 to n do
begin
  if bld[c].price < maxprice then
  begin
     maxprice := bld[c].price;
     max := c;
  end;
end;

writeln;writeln('Informaciq za nai-evtinata sgrada:');
writeln(bld[max].archname);
writeln(bld[max].price:1:2);

readln;
end.

Е т`ва е! Мерси братче :)

Адски благодарен съм :rolleyes:

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...