ParsX.com
پذیرش پروژه از دانشجویی ... تا سازمانی 09376225339
 
   ProfileProfile   Log in to check your private messagesLog in to check your private messages  |  FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups Log inLog in   RegisterRegister 

مشخصات دانشجو را دريافت كرده و بر حسب نام مرتب مي كند.

 
Post new topic   Reply to topic    ParsX.com Forum Index -> برنامه نويسي دلفي و پاسكال : Delphi & Pascal Programming
View previous topic :: View next topic  
Author Message
hamid_200611
مهمون يكي دو روزه


Joined: 06 Dec 2006
Posts: 2

PostPosted: Wed Dec 06, 2006 10:38 am    Post subject: مشخصات دانشجو را دريافت كرده و بر حسب نام مرتب مي كند. Reply with quote

dd[/code]
Back to top
hamid_200611
مهمون يكي دو روزه


Joined: 06 Dec 2006
Posts: 2

PostPosted: Wed Dec 06, 2006 10:39 am    Post subject: Reply with quote

program one;
uses crt;
type
student=record
name:string[10];
lastname:string[15];
id:integer;
address:string;
end;
arstudent=array[1..2] of student;
var
s:arstudent;
j:integer;
procedure drowbox;
var
intcol:integer;
begin
clrscr;
gotoxy(5,3);
write(#218);
for intcol:=1 to 70 do
write(#196);
gotoxy(75,3);
write(#191);
gotoxy(75,4);
write(#179);
gotoxy(75,5);
write(#179);

gotoxy(69,3);
write(#194);
gotoxy(69,4);
write(#179);
gotoxy(69,5);
write(#179);
gotoxy(5,4);
write(#179);
gotoxy(5,5);
write(#179);
gotoxy(55,3);
write(#194);
gotoxy(55,4);
write(#179);
gotoxy(55,5);
write(#179);

gotoxy(37,3);
write(#194);
gotoxy(37,4);
write(#179);
gotoxy(37,5);
write(#179);
gotoxy(18,3);
write(#194);
gotoxy(18,4);
write(#179);
gotoxy(18,5);
write(#179);
gotoxy(5,6);
write(#192);
for intcol:=1 to 69 do
write(#196);
gotoxy(75,6);
write(#217);

for intcol:=7 to 25 do
begin
gotoxy(5,intcol);
write(#179);
gotoxy(75,intcol);
write(#179);
gotoxy(18,intcol);
write(#179);
gotoxy(37,intcol);
write(#179);
gotoxy(69,intcol);
write(#179);
gotoxy(55,intcol);
write(#179);
end

end;




كه خروجي اين رويه شكل زير است.


















رويه دوم مربوط به علائم روي جدول است.


procedure rite;
var
k:integer;
begin
gotoxy(71,4);
write('num');
gotoxy(63,4);
write('name ');
gotoxy(40,4);
write('last name ');
gotoxy(22,4);
write('id ');
gotoxy(7,4);
write('address');
for k:=7 to 25 do
begin
gotoxy(72,k);
write(k-6);
end

end;





و باعث مي شود خروجي به صورت زير باشد.


















رويه سوم مربوط به مرتب سازي با نام sort مي باشد.



procedure sort(var list:arstudent);
var
intpos,intfpos,intmin:integer;
rec:student;
begin
for intfpos :=low(list) to high(list) do
begin
intmin:=intfpos;
for intpos :=intfpos+1 to high(list) do
if (list[intmin].lastname>list[intpos].lastname) or
((list [intmin].lastname=list[intpos].lastname) and
(list[intmin].name>list[intpos].name)) then
intmin:=intpos;
rec:=list[intmin];
list[intmin]:=list[intfpos];
list[intfpos]:=rec;
end
end;
procedure sort(var list:arstudent);
var
intpos,intfpos,intmin:integer;
rec:student;
begin
for intfpos :=low(list) to high(list) do
begin
intmin:=intfpos;
for intpos :=intfpos+1 to high(list) do
if (list[intmin].lastname>list[intpos].lastname) or
((list [intmin].lastname=list[intpos].lastname) and
(list[intmin].name>list[intpos].name)) then
intmin:=intpos;
rec:=list[intmin];
list[intmin]:=list[intfpos];
list[intfpos]:=rec;
end
end;
procedure sort(var list:arstudent);
var
intpos,intfpos,intmin:integer;
rec:student;
begin
for intfpos :=low(list) to high(list) do
begin
intmin:=intfpos;
for intpos :=intfpos+1 to high(list) do
if (list[intmin].lastname>list[intpos].lastname) or
((list [intmin].lastname=list[intpos].lastname) and
(list[intmin].name>list[intpos].name)) then
intmin:=intpos;
rec:=list[intmin];
list[intmin]:=list[intfpos];
list[intfpos]:=rec;
end
end;
Back to top
Display posts from previous:   
Post new topic   Reply to topic    ParsX.com Forum Index -> برنامه نويسي دلفي و پاسكال : Delphi & Pascal Programming All times are GMT + 3.5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum