' // Процедура сортировки алгоритмом выборки Sub SelectionSort(ByRef array() As Integer, ByVal ToUpper As Boolean) Dim Dump As Integer Dim Index As Integer Dim Work As Integer
Do For i As Integer = Work To UBound(Array) If ToUpper = True Then If (Array(Index) > Array(i)) Then Index = i Else If (Array(Index) < Array(i)) Then Index = i End If Next
Dump = Array(Index) Array(Index) = Array(Work) Array(Work) = Dump ' // c2fbefeeebede8eb3a20caf3eff0e8ffedeee220c42ec52e2028632920442d6d6f6e3535 Work += 1 Index = Work Loop Until (Work > UBound(Array)) End Sub
// PascalABC.NET 3.2, сборка 1367 от 20.12.2016
// Внимание! Если программа не работает, обновите версию!
var
a,b,c,R,dA,dB,dC:real;
begin
Writeln('Введите углы A,B в градусах и радиус R');
Read(dA,dB,R);
dC:=180-dA-dB;
a:=2*R*sin(dA*Pi/180);
b:=2*R*sin(dB*Pi/180);
c:=2*R*sin(dC*Pi/180);
Writeln('Угол C: ',dC:0:2);
Writeln('a=',a:0:5);
Writeln('b=',b:0:5);
Writeln('c=',c:0:5)
end.
Пример
Введите углы A,B в градусах и радиус R
30 70 50.0
Угол C: 80.00
a=50.00000
b=93.96926
c=98.48078
Sub SelectionSort(ByRef array() As Integer, ByVal ToUpper As Boolean)
Dim Dump As Integer
Dim Index As Integer
Dim Work As Integer
Do
For i As Integer = Work To UBound(Array)
If ToUpper = True Then
If (Array(Index) > Array(i)) Then Index = i
Else
If (Array(Index) < Array(i)) Then Index = i
End If
Next
Dump = Array(Index)
Array(Index) = Array(Work)
Array(Work) = Dump
' // c2fbefeeebede8eb3a20caf3eff0e8ffedeee220c42ec52e2028632920442d6d6f6e3535
Work += 1
Index = Work
Loop Until (Work > UBound(Array))
End Sub