![]() |
|
|
|||||||
| Регистрация | << Правила форума >> | FAQ | Пользователи | Календарь | Поиск | Сообщения за сегодня | Все разделы прочитаны |
|
|
Опции темы | Поиск в этой теме | Опции просмотра |
|
#1
|
|||
|
|||
|
Здравствуйте!
Помогите пожалуйста решить задачу. Есть процедура Код:
procedure write_outfile_new(l,alpha,fi_s,mashi:integer; t:real);
var
Xa,Yb,k: integer;
begin
AssignFile(outfile, 'outfile.txt');
Reset(outfile);
AssignFile(new_outfile, 'new_outfile.txt');
ReWrite(new_outfile);
while not Seekeof(outfile) do begin
read(outfile, Xa);
read(outfile, Yb);
if sqrt(sqr(Xa-t*alpha*cos(fi_s*pi/180)*mash/mashi)+sqr(Yb-t*alpha*sin(fi_s*pi/180)*mash/mashi))<(l*mash/mashi) then
begin
Append(new_outfile);
writeln(new_outfile, Xa,' ',Yb);
end
end;
CloseFile(new_outfile);
CloseFile(outfile);
sl1:= TStringList.Create;
sl2:= TStringList.Create;
Try
sl1.LoadFromFile('outfile.txt');
sl2.LoadFromFile('new_outfile.txt');
for g := sl1.Count - 1 downto 0 do
if sl2.IndexOf(sl1[g]) >= 0 Then sl1.Delete(g);
sl1.SaveToFile('outfile.txt');
Finally
sl1.Free;
sl2.Free;
End;
end;Код:
if Form1.RadioButton1.Checked then begin search_traectory_t(l,25,alpha,t); end; if Form1.RadioButton2.Checked then begin search_traectory_t(l,30,alpha,t); search_traectory_t(l,60,alpha,t); end; if Form1.RadioButton3.Checked then begin search_traectory_t(l,22,alpha,t); search_traectory_t(l,45,alpha,t); search_traectory_t(l,67,alpha,t); end; Первые два условия срабатывают, третье в никакую не хочет. Заранее спасибо за ответы! |