Добавил:
Источник:
Uman
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:01 семестр / К экзамену-зачёту / Все задачи с экзамена в формате PAS / Alex / B1
.PAS program magazine;
uses crt;
const nos=3;
nom=4;
type student=record
name:string[20];
group:string[5];
mark:array[1..nom] of shortint;
end;
var
b:array [1..nom] of boolean;
i,o:integer;
mag:array[1..nos] of student;
f:text;
begin
clrscr;
for i:=1 to nos do begin
write ('‚ўҐ¤ЁвҐ Ё¬п: ');
readln (mag[i].name);
write ('‚ўҐ¤ЁвҐ ЈагЇЇг:');
readln (mag[i].group);
for o:=1 to nom do begin
write ('‚ўҐ¤ЁвҐ ',o,'-го ®жҐЄг: ');
readln (mag[i].mark[o]);
end;
end;
writeln ('‚ў®¤ Ў §л ¤ ле § ўҐаиҐ');
readln;
clrscr;
for i:=1 to nos do begin
write (i,' ');
writeln ('€¬п : ',mag[i].name);
writeln ('ѓагЇЇ : ',mag[i].group);
for o:=1 to nom do begin
writeln (o,'-п ®жҐЄ : ',mag[i].mark[o]);
end;
end;
writeln;
writeln ('Ћ’‹€—Ќ€Љ€ € •ЋђЋ€‘’›');
assign (f,'magazine.txt');
rewrite (f);
writeln (f,'---------- †га « Ћ’‹€—Ќ€ЉЋ‚ Ё •ЋђЋ€‘’Ћ‚ ----------');
for i:=1 to nos do begin
b[i]:=false;
for o:=1 to nom do begin
if (mag[i].mark[o])<4 then b[i]:=true;
end;
if (b[i]=false) then begin
writeln (f,'‘в㤥в: ',mag[i].name);
write ('€¬п: ',mag[i].name);
writeln (f,'ѓагЇЇ : ',mag[i].group);
writeln (' ѓагЇЇ : ',mag[i].group);
for o:=1 to nom do writeln (f,o,'-п ®жҐЄ : ',mag[i].mark[o]);
writeln (f,'');
end;
end;
close (f);
writeln ('‡ ¤ ЁҐ ўлЇ®«Ґ®');
readln;
end.
uses crt;
const nos=3;
nom=4;
type student=record
name:string[20];
group:string[5];
mark:array[1..nom] of shortint;
end;
var
b:array [1..nom] of boolean;
i,o:integer;
mag:array[1..nos] of student;
f:text;
begin
clrscr;
for i:=1 to nos do begin
write ('‚ўҐ¤ЁвҐ Ё¬п: ');
readln (mag[i].name);
write ('‚ўҐ¤ЁвҐ ЈагЇЇг:');
readln (mag[i].group);
for o:=1 to nom do begin
write ('‚ўҐ¤ЁвҐ ',o,'-го ®жҐЄг: ');
readln (mag[i].mark[o]);
end;
end;
writeln ('‚ў®¤ Ў §л ¤ ле § ўҐаиҐ');
readln;
clrscr;
for i:=1 to nos do begin
write (i,' ');
writeln ('€¬п : ',mag[i].name);
writeln ('ѓагЇЇ : ',mag[i].group);
for o:=1 to nom do begin
writeln (o,'-п ®жҐЄ : ',mag[i].mark[o]);
end;
end;
writeln;
writeln ('Ћ’‹€—Ќ€Љ€ € •ЋђЋ€‘’›');
assign (f,'magazine.txt');
rewrite (f);
writeln (f,'---------- †га « Ћ’‹€—Ќ€ЉЋ‚ Ё •ЋђЋ€‘’Ћ‚ ----------');
for i:=1 to nos do begin
b[i]:=false;
for o:=1 to nom do begin
if (mag[i].mark[o])<4 then b[i]:=true;
end;
if (b[i]=false) then begin
writeln (f,'‘в㤥в: ',mag[i].name);
write ('€¬п: ',mag[i].name);
writeln (f,'ѓагЇЇ : ',mag[i].group);
writeln (' ѓагЇЇ : ',mag[i].group);
for o:=1 to nom do writeln (f,o,'-п ®жҐЄ : ',mag[i].mark[o]);
writeln (f,'');
end;
end;
close (f);
writeln ('‡ ¤ ЁҐ ўлЇ®«Ґ®');
readln;
end.
Соседние файлы в папке Alex