Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function CheckForComputersAmount(Computers : MainUnit.TArray) : Integer;
- Var
- I : Integer;
- Num : Integer;
- begin
- Num := 0;
- For I := 0 To High(Computers) Do
- Begin
- If(Computers[I].Guarantee <= 2) Then
- Inc(Num);
- End;
- CheckForComputersAmount := Num;
- end;
- function FindDoneComputers(Amount : Integer; Computers : MainUnit.TArray) : MainUnit.TArray;
- var
- DoneComputers : MainUnit.TArray;
- I, J : Integer;
- Temp : MainUnit.TObjects;
- begin
- SetLength(DoneComputers, Amount);
- J := 0;
- For I := 0 To High(Computers) Do
- Begin
- If(Computers[I].Guarantee <= 2) Then
- Begin
- DoneComputers[J] := Computers[I];
- Inc(J);
- End;
- End;
- For I := 0 To High(DoneComputers) Do
- Begin
- For J := 0 To (High(DoneComputers) - I - 1) Do
- Begin
- If(DoneComputers[J].Price < DoneComputers[J+1].Price) Then
- Begin
- Temp := DoneComputers[J];
- DoneComputers[J] := DoneComputers[J+1];
- DoneComputers[J+1] := Temp;
- End;
- End;
- End;
- FindDoneComputers := DoneComputers;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement