You are not logged in.
hi guys
i've been doing my programming homework and i got an error,but don't know where's the problem.
here's the code.it's Pascal and written in Lazarus v0.9.28.2 beta:
program Project1;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Classes
{ you can add units after this };
const
k=100;
type
niz=array[1..k] of real;
matrica=array[1..k] of niz;
var
a:matrica;
n,i,j:integer;
procedure exchange(x,y:real);
var p:real;
begin
p:=x;
x:=y;
y:=p;
end;
procedure QuickSort(var a:matrica;var b:niz;levi,desni,n:integer);
var
i,j,k:integer;
D:real;
begin
if levi<desni then
begin
i:=levi;
j:=desni;
D:=b[desni];
repeat
while b[i]<D do
i:=i+1;
while (b[j]>=D) and (i<j) do
j:=j-1;
if i<j then
begin
exchange(b[i],b[j]);
for k:=1 to n do
exchange(a[i][k],a[j][k]);
end;
until i=j;
exchange(b[i],b[desni]);
QuickSort(a,b,levi,i-1,n);
QuickSort(a,b,i+1,desni,n);
end;
end;
procedure GrowingRows(var a:matrica;n:integer);
var
b:niz;
i:integer;
begin
for i:=1 to n do
------------b[i]=a[i][1];------------
QuickSort(a,b,1,n,n);
end;
begin
write('Enter the number of rows of the square matrix: ');
readln(n);
for i:=1 to n do
begin
for j:=1 to n do
read(a[i][j]);
readln;
end;
GrowingRows(a,n);
for i:=1 to n do
for j:=1 to n do
write(a[i][j]);
readln;
end.i have marked the line in problem and the error message says:'Error: Illegal expression' ![]()
well,i think it was meant for student cases,and it means that students don't really check the solutions and/or examples given by work or any sheets for that matter.
hi bobbym
that picture is disgusting.
hi ganesh
i have heard of both but don't know who wrote them. ![]()
i know that we were a province,but not sure 'bout the emperors.
yes,Yugoslavia,but it fell apart and now Croatia and Serbia hate each others guts!
where do you live?
yes i know.i hear that in america they don't care that much about history.
we were in the First and Second World War,but i don't know how known that fact is.
we were under the Turks for around 500 years.
it's not unknown,it's just not that known either.
yup.we are somewhat aware of that.but it's okay.
hi Sarah.
how are you.has your period passed?
to you,bobz ![]()
bobbym=bobz.get used to it.
i think that Serbia is not a well-known country,and so do all Serbian people.
i get surprised when people from other countries that are far enough know where Serbia is.
hi bobz
you changed your avatar again.this is one is nicer than the last one! ![]()
hi Sarah
"do you have a wife?"
what the...? i'm 14.
i was kidding.he's not that mean ![]()
that's good.fortunately (and unfortunately), it's only once a month or so.
anyway,it's better than if it skips,because it means a whole other and worse thing.
he won't.he's mean and sarcastic on the outside,but he has a kind heart.
hi Sarah
how's the cramping,and the...?
where can i find it?
i don't know any of that stuff.what about 19?
18535
3*5-8+5+1
anyone know how to do these?
yes i have noticed that,and i was about to ask why.i hope that too.
well anyone can provide if they can find them.
I am not getting older,I'm just not getting younger!