Не знаю насколько это правильно, на Паскале никогда не программировал, но код скину:
Задача 1:
var a, b, c: integer;
begin
readln (a);
readln (b);
readln (c);
if a > b then
if a < c then
write (a);
if a > c then
if a < b then
write (a);
if b > a then
if b < c then
write (b);
if b > c then
if b < a then
write (b);
if c > a then
if c < b then
write (c);
if c > b then
if c < a then
write (c);
if a = b then
a := b;
if b = c then
a := b;
c := a;
write (a);
readln
end.
Задача 2:
var a, b, c: integer;
begin
readln (a);
readln (b);
readln (c);
if a > b then
if a > c then
write (a);
if b > a then
if b > c then
write (b);
if c > a then
if c > b then
write (c);
if a = b then
a := b;
if b = c then
a := b;
c := a;
write (a);
readln
end.
13
Объяснение:
s = 0 i = 5
Действия в цикле:
1) s = s + 6 div i
2) i = i - 1
Цикл продолжает работу пока ложно (нет) условие i < 1
Вывод s
s = 0 i = 5
Действия в цикле:
1) s = s + 6 div i = 0 + 6 div 5 = 0 + 1 = 1
2) i = i - 1 = 5 - 1 = 4
4 < 1 (нет)
s = 1 i = 4
Действия в цикле:
1) s = s + 6 div i = 1 + 6 div 4 = 1 + 1 = 2
2) i = i - 1 = 4 - 1 = 3
3 < 1 (нет)
s = 2 i = 3
Действия в цикле:
1) s = s + 6 div i = 2 + 6 div 3 = 2 + 2 = 4
2) i = i - 1 = 3 - 1 = 2
2 < 1 (нет)
s = 4 i = 2
Действия в цикле:
1) s = s + 6 div i = 4 + 6 div 2 = 4 + 3 = 7
2) i = i - 1 = 2 - 1 = 1
1 < 1 (нет)
s = 7 i = 1
Действия в цикле:
1) s = s + 6 div i = 7 + 6 div 1 = 7 + 6 = 13
2) i = i - 1 = 1 - 1 = 0
0 < 1 (да)
Цикл заканчивает работу
s = 13 i = 0
Private Sub CommandButton1_Click()
Dim A(1 To 5, 1 To 5) As Single
Dim i As Integer, j As Integer, k As Integer
Dim sr As String
k = 0
ListBox1.Clear
For i = 1 To 5
sr = ""
For j = 1 To 5
A(i, j) = i + 0.5 * j
sr = sr + " " + Format(A(i, j), "0.000") + " "
If (A(i, j) > 1) And (A(i, j) < 2.5) Then k = k + 1
Next j
ListBox1.AddItem (sr)
Next i
TextBox1.Text = Str(k)
End Sub
А если неверно запрограммировано, то надо знать, что и как должно делаться.