1 / 4

Mit ír ki a program

a(1)= 5, a(2)= 1, a(3)= 10, a(4)= 3. i, m : egész a(1..4) : egész. i = 1. hamis. kiír( a(4), m). i<= 3. v ége. igaz. igaz. a(i) > a(i+1). m= a(i) a(i)= a(i+1) a(i+1)= m. hamis. kiír( a(i), m) i = i+1. Mit ír ki a program. a(1)= 5, a(2)= 1, a(3)= 10, a(4)= 3.

odeda
Download Presentation

Mit ír ki a program

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. a(1)= 5, a(2)= 1, a(3)= 10, a(4)= 3 i, m : egész a(1..4) : egész i = 1 hamis kiír( a(4), m) i<= 3 vége igaz igaz a(i) > a(i+1) m= a(i) a(i)= a(i+1) a(i+1)= m hamis kiír( a(i), m) i = i+1 Mit ír ki a program

  2. a(1)= 5, a(2)= 1, a(3)= 10, a(4)= 3 i = 1 a(1)= 5, a(2)= 1, a(3)= 10, a(4)= 3 i, m : egész a(1..4) : egész igaz a(i) > a(i+1) m= a(i) a(i)= a(i+1) a(i+1)= m i = 1 hamis hamis kiír( a(4), m) i<= 3 vége igaz igaz kiír( a(i), m) i = i+1 a(i) > a(i+1) m= a(i) a(i)= a(i+1) a(i+1)= m hamis igaz kiír( a(4), m) i> 3 hamis kiír( a(i), m) i = i+1 vége A blokk-diagram átalakítása

  3. a(1)= 5, a(2)= 1, a(3)= 10, a(4)= 3 i = 1 igaz a(i) > a(i+1) m= a(i) a(i)= a(i+1) a(i+1)= m hamis kiír( a(i), m) i = i+1 igaz kiír( a(4), m) i> 3 hamis vége Program megírása Sub mit_ir_ki() End Sub Dim a%(5), i%, m% a(1)= 5: a(2) = 1 a(3) = 10: a(4) = 3 i = 1 Do Loop Until a > 3 If a(i) > a(i + 1) Then Else End if m = a(i) a(i) = a(i + 1) a(i + 1) = m Cells( i , 1) = a(i): Cells( i , 2) = m i = i + 1 Cells(i,1) = a(i): Cells(i,2) = m

  4. Tömb feltöltés (eljárás nélkül) Sub feltolt() Dim A%(50, 100), m%, n% m = InputBox("sor száma = m = ? ") n = InputBox("oszlop száma = n = ?") For i = 1 To m Forj = 1 To n A(i, j) = i - j Cells(i, j) = A(i, j) Next j Nexti End Sub pl. m = 5 n = 7 esetén

More Related