Помощь - Поиск - Пользователи - Календарь
Полная версия: Файл
Форум «Всё о Паскале» > Pascal, Object Pascal > Задачи
Terror13
Помогите исправить ошибку пожалуйста.Программа компилируется, но В конце не Дальше read(x); не и дет в чем дело. Заранее благодарен.
Код
uses crt;
type
item = record
   title: string[30];
   price: real;
   age_1,age_2: byte;
   col_vo:integer;
end;
var
a,b,x:integer;
i,n:byte;
maxp:real;
info: array[1 .. 255] of item;
begin
clrscr;
write('Vvedite col-vo tovarov ');
readln(n);
for i:=1 to n do begin
with info[i] do begin
   writeln(' Vvedite dannie for ',i,' igreshki :');
   write(' Nazvanie: ');
   readln(title);
   write(' Ctoimost: ');
   readln(price);
   if price>maxp then maxp:=price;
   write(' col-vo: ');
   read(col_vo);
   write(' Vozrastnie prideli (cherez probel): ');
   readln(age_1,age_2);
end;
end;
clrscr;
writeln(' Cled. igr.nodhod. detim ot 1 do 3 let');
for i:=1 to n do begin
with info[i] do begin
   if (age_1=1) and (age_2=3) then
   writeln(title);
end;
end;
writeln('Samoy dorogoy igryshka ');
for i:=1 to n do begin
with info[i] do begin
   if price=maxp then begin
     writeln(' Ctoimost: ',maxp);
     writeln(' Nazvanie: ',title);
   end;
end;
end;
writeln(' Vozrastnie prideli (cherez probel):');
read(a,b);
writeln(' Ogran. price :');
read(x);
for i:=1 to n do begin
with info[i] do begin
   if (age_1<a) and (age_2>b) then
   writeln(' Nazvanie: ',title);
   if x>maxp then begin
   writeln(' Ctoimost: ',maxp);
   readln;
    end;
   end;
end;
end.
Pola
Хм... не зная задания...
uses crt;
type
item = record
title: string[30];
price: real;
age_1,age_2: byte;
col_vo:integer;
end;
var
a,b,x:integer;
i,n:byte;
maxp:real;
info: array[1 .. 255] of item;
begin
clrscr;
write('Vvedite col-vo tovarov ');
readln(n);
for i:=1 to n do begin
with info[i] do begin
writeln(' Vvedite dannie for ',i,' igreshki :');
write(' Nazvanie: ');
readln(title);
write(' Ctoimost: ');
readln(price);
if price>maxp then maxp:=price;
write(' col-vo: ');
read(col_vo);
write(' Vozrastnie prideli (cherez probel): ');
readln(age_1,age_2);
end;
end;
clrscr;
writeln(' Cled. igr.nodhod. detim ot 1 do 3 let');
for i:=1 to n do begin
with info[i] do begin
if (age_1<=1) and (age_2>=3) then
writeln(title);
end;
end;
writeln('Samoy dorogoy igryshka ');
for i:=1 to n do begin
with info[i] do begin
if price=maxp then begin
writeln(' Nazvanie: ',title);
writeln(' Ctoimost: ',maxp:8:2);
end;
end;
end;
writeln(' Vozrastnie prideli (cherez probel):');
readln(a,b);
writeln(' Ogran. price :');
readln(x);
for i:=1 to n do begin
with info[i] do begin
if (age_1<=a) and (age_2>=b) then
writeln(' Nazvanie: ',title);
if x>=price then begin
writeln(' Nazvanie: ',title,' Ctoimost: ',price:8:2);
readln;
end;
end;
end;

writeln; write('Press ENTER...');
readln;
end.


Так лучше?
Это текстовая версия — только основной контент. Для просмотра полной версии этой страницы, пожалуйста, нажмите сюда.