search points attachment profile arrow left arrow right star heart verified symbols equation arrow-down question mark check menu accountancyadministrationagriculturalalgebraallarabicartart_musicbelarusbelarus_altbiologybusinesscatalachemistrychineseeconomicsegzamenglishentrepreneurshipenvironmentethicseuskarafirst_aidfrenchgalegogeographygeologygeometrygermangrammarhealthhistoryindia_langindonesian_langinformaticsitalianjapanesekazachkazach_altkoreanlanguagelatinlawlife_scienceliteraturelogicmathematicsmusicnigerian_langother_languagesotherspedagogicsphilosophyphysical_educationphysicspoliticspsychologyreligionrpa_langrussianrussian_altsciencesecurityskillssocial_sciencesociologyspanishstatisticstechnologytourismtrafficukrainianukrainian_altukrainian_literaturewos_civilisation accountancyadministrationagriculturalalgebraall_1arabicartart_music_2belarusbelarus_altbiologybusiness_2catalachemistry_1chineseeconomicsexam_3englishentrepreneurshipenvironment_2ethicseuskarasecurity_1frenchgalegogeography_4geology_4geometrygermangrammarhealthhistoryindia-langindonesian-langinformaticsitalianjapanesekazachAsset 230koreanlanguagelatinlawlife-scienceliteraturelogic_2mathematicsmusicnigerian-langotherlanguagesother_1pedagogicsphilosophyphysical_educationphysicspoliticspsychologyreligion_1rpa-langrussianrussian_altsciencesecurity_3_mskills_1allsocial_science_5_msociologyspanishstatisticstechnologytourismtrafficukrainianukrainian_altukrainian_literaturewos_civilisation
Автор - Анилай

Срочно написать программу в паскале!
Упорядочить массив в интервале от i1 до i2 по убыванию

Ответ

Автор - conikx1
Sub test()
'массив и диапазон для примера
m = Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
i1 = 2 'с 3-го злемента (0,1,2)
i2 = 7 'по восьмой
'собственно, сам алгоритм
For x = i1 To i2 - 1
For y = x + 1 To i2
If m(x) < m(y) Then tmp = m(x): m(x) = m(y): m(y) = tmp
Next y, x
MsgBox Join(m, ";") 'это просто проверка
End Sub
Надеюсь помог

Ответы и объяснения

По всем вопросам пишите на - vashurokk@rambler.ru
© 2025 Все права защищены