Перейти из форума на сайт.

НовостиФайловые архивы
ПоискАктивные темыТоп лист
ПравилаКто в on-line?
Вход Забыли пароль? Первый раз на этом сайте? Регистрация
Компьютерный форум Ru.Board » Компьютеры » Прикладное программирование » Задачи на Pascal/Object Pascal/Free Pascal (Delphi/Lazarus)

Модерирует : ShIvADeSt

 Версия для печати • ПодписатьсяДобавить в закладки
На первую страницук этому сообщениюк последнему сообщению

Открыть новую тему     Написать ответ в эту тему

ThrashScream

Newbie
Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору
program KR;
uses crt;
type
name=record
familia: string[20];
ima: string[20];
otchestvo: string[20];
end;
date=record
day:1..31;
mounth:1..12;
year:2000..3000;
end;
Exam = Record
            FIO: name;
            Group: string[20];
            data: date;
            Pol: char;
            god_postyplenia: integer;
            razmer_stipendii: integer;
            Mesto_Jitelstva: string[20];
            end;
            Mass = Array [1..30] of Exam;
Var Student: Array [1..30] of Exam;
Num, I, OutNum: integer;
letter: char;
FileName: text;
outyear,col: integer;
Procedure InputStudent(var InpNum: integer);
var I: integer;
begin
clrscr;
write ('Enter quantity students: ');
readln (inpnum);
for I:=1 to inpnum do
with Student[i] do
begin
writeln ('Enter FIO student',I, ': ');
write ('Surname: '); readln (FIO.familia);
write ('Name: '); readln (FIO.ima);
write ('Fathername: '); readln (FIO.otchestvo);
write ('Enter students group: '); readln (student[i].group);
writeln ('Enter date birthday of student: ');
write ('Day: '); readln (data.day);
write ('Mounth: '); readln (data.mounth);
write ('Year: '); readln (data.year);
write ('Enter sex student: '); readln (student[i].Pol);
write ('Enter year entering to institute: '); readln (student[i].god_postyplenia);
write ('Size of grant: '); readln (student[i].razmer_stipendii);
write ('Town: '); readln (student[i].mesto_jitelstva);
writeln;
end;
end;
procedure OutLine (Line: integer);
begin
write (FileName,student[line].fio.familia:15);
write (FileName,student[line].fio.ima:10);
write (FileName,student[line].fio.otchestvo:20);
write (FileName,student[line].group:10);
write (FileName,student[line].data.day:9);
write (FileName,student[line].data.mounth:9);
write (FileName,student[line].data.year:9);
write (FileName,student[line].pol:10);
write (FileName,student[line].god_postyplenia:20);
write (FileName,student[line].razmer_stipendii:20);
write (FileName,student[line].mesto_jitelstva:20);
writeln(FileName);
end;
procedure OutStudent (OutNum: integer);
Var I: integer;
begin
clrscr;
writeln (FileName,'Data of all students: ');
write (FileName,'Surname':15,'Name':10,'Fathername':20,'Group':10,'Day':9,'Mounth':9,'Year':9,'Sex':10,'Year entering':20);
writeln (FileName, 'Size of grant':20,'Town':20);
write (FileName,'-------------------------------------------------------------------------------------------');
writeln (FileName,'----------------------------------------------------------------');
For I:=1 To OutNum do outline (I);
end;
{Opredelenie kolichestva ludey po gryppam postypivwux v y4e6noe zavedenie}
procedure   OutStudentColPost (OutNum, OutYear: integer);
var I,col: integer;
begin
col:=0;
writeln (filename);
write('Enter year entering to institute:  ');
read(outyear);
writeln (FileName, 'Data of student,who entered to institute in ',OutYear,' year: ');
write (FileName,'Surname':15,'Name':10,'Fathername':20,'Group':10,'Day':9,'Mounth':9,'Year':9,'Sex':10,'Year entering':20);
writeln (FileName, 'Size of grant':20,'Town':20);
write (FileName,'-------------------------------------------------------------------------------------------');
writeln (FileName,'----------------------------------------------------------------');
For I:=1 To 100 do
If (outyear=student[i].god_postyplenia) then
begin
col:=col+1;
outline (I);
end;
writeln (FileName, 'Quantity people entered to institute in ',OutYear,' year',': ',col);
end;
begin
Assign (FileName,'Result.txt');
Rewrite(FileName);
InputStudent (num);
OutStudent (Num);
 
OutStudentColPost (OutNum,OutYear);
close(FileName);
WriteLn ('Create file C:\Program Files\TP\Bin\Result.txt');
readkey;
end.

Всего записей: 4 | Зарегистр. 23-11-2008 | Отправлено: 01:59 02-12-2008
Открыть новую тему     Написать ответ в эту тему

На первую страницук этому сообщениюк последнему сообщению

Компьютерный форум Ru.Board » Компьютеры » Прикладное программирование » Задачи на Pascal/Object Pascal/Free Pascal (Delphi/Lazarus)


Реклама на форуме Ru.Board.

Powered by Ikonboard "v2.1.7b" © 2000 Ikonboard.com
Modified by Ru.B0ard
© Ru.B0ard 2000-2024

BitCoin: 1NGG1chHtUvrtEqjeerQCKDMUi6S6CG4iC

Рейтинг.ru