Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Uses crt;
- type
- info = record
- fio:string[19];
- year:integer;
- visa:char;
- male:char;
- end;
- masType = array[1..10] of info;
- var
- mas:masType;
- i,err,j:integer;
- c:char;
- year:string;
- (*procedure sortirovka(var mas:masType);
- var
- i,j,err,year1,k,year2,count:integer;
- sex,p : char;
- buf:string;
- begin
- i:=1;
- while(i<=10) do
- begin
- //val(copy(mas[i],20,4),year,err);
- if (mas[i][24]='P') and (mas[i][25]='M') then
- begin
- buf := mas[i];
- for j:=i downto 2 do
- begin
- mas[j] := mas[j-1];
- end;
- mas[1] := buf;
- inc(count);
- end;
- inc(i);
- //writeln(year);
- end;
- for i:=1 to count-1 do
- begin
- for j:= i+1 to count do
- begin
- val(copy(mas[i],20,4),year1,err);
- val(copy(mas[j],20,4),year2,err);
- if(year1 < year2) then
- begin
- buf := mas[i];
- mas[i]:= mas[j];
- mas[j] := buf;
- end;
- end;
- end;
- end;*)
- begin
- assign(input,'input.txt');
- reset(input);
- //assign(output,'output.txt');
- //rewrite(output);
- for i:=1 to 10 do
- begin
- for j:=1 to 19 do
- begin
- read(input,c);
- mas[i].fio := mas[i].fio + c;
- end;
- year := '';
- for j:=1 to 4 do
- begin
- read(input,c);
- year := year + c;
- end;
- val(year,mas[i].year,err);
- read(input,mas[i].visa);
- readln(input,mas[i].male);
- end;
- close(input);
- for i:=1 to 10 do
- begin
- writeln(mas[i].fio,mas[i].year,' ',mas[i].visa,' ',mas[i].male);
- end;
- assign(output,'output.txt');
- rewrite(output);
- for i:=1 to 10 do
- begin
- writeln(output,mas[i].fio,mas[i].year,' ',mas[i].visa,' ',mas[i].male);
- end;
- close(output);
- (*for i:=1 to 10 do
- writeln(mas[i]);
- sortirovka(mas);
- writeln;
- for i:=1 to 10 do
- writeln(mas[i]);
- append(output);
- writeln(output);
- for i:=1 to 3 do
- begin
- writeln(output,mas[i]);
- end;
- close(output);
- writeln;
- for i:=1 to 3 do
- begin
- writeln(mas[i]);
- end;
- *)
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement