Показать сообщение отдельно
  #11  
Старый 13.05.2008, 13:48
Cathrinka Cathrinka вне форума
Прохожий
 
Регистрация: 23.04.2008
Сообщения: 9
Репутация: 10
По умолчанию

Может кто найдет ошибочку: "ProjectProject1.exe raised exception class EConvertError winh message "is not a valid integer value". Process stopped. Use step or Run to continue." Я изменила размеры массива и взяла абциссу в первой строке StringGrid'a, а ординату во второй!
Код:
procedure TForm1.Button1Click(Sender: TObject);
type s=array [(x,y)] of real;
var H: array [1..10] of s;
   d,max:real; i,j:integer;
begin
for i:=1 to n do
for j:=1 to m do
a[i,j]:=StrToFloat(StringGrid1.Cells[j-1,1]);
for i:=1 to n do
for j:=1 to m do
b[i,j]:=StrToFloat(StringGrid1.Cells[j-1,1]);
for i:=1 to n do
for j:=1 to m do
c[i,j]:=StrToFloat(StringGrid1.Cells[j-1,2]);
for i:=1 to n do
for j:=1 to m do
e[i,j]:=StrToFloat(StringGrid1.Cells[j-1,2]);
for j:=1 to m do d:=0;
d:=sqrt(sqr(a[i,j]-b[i,j])+sqr(c[i,j]-e[i,j]));
 for i:=1 to n do
 begin
 max:=0;
 for j:=1 to m do
 if d>max then max:=d;
 end;
ShowMessage('расстояние=' +FloatToStr(max));
end;

end.

Aristarh Dark: Используй тэги. Второе замечание в одной теме, еще раз - бан на неделю
Ответить с цитированием