Task 2 Use of English. Open the bracket in will be or going to
1 Philip (learn) French next year on Sunday.
2 Look at the window. It (snow).
3 I think I (watch)TV whole day in my holiday.
Put the sentences should, have to and mustn`t
4 You go to the museum without ticket.
5 You take a blue jacket. It suits you perfectly!
6 Dmitry (not throw) the rubbish on the street.
//Pascal
const m = 1000
var
arr: array[1..m] of integer;
n,i, j, k: integer;
begin
readln(n);
write ('Исходный массив: ');
for i := 1 to n do begin
readln(arr[i]);
end;
//сортировка методом пузырька
for i := 1 to n-1 do
for j := 1 to n-i do
if arr[j] > arr[j+1] then begin
k := arr[j];
arr[j] := arr[j+1];
arr[j+1] := k
end;
write ('Отсортированный массив: ');
for i := 1 to n do
write (arr[i]:4);
end.
Алгоритм сортировки на классическом языке программирования С
# define SWAP(A,B) {A=A^B;B=A^B;A=A^B;}
void bubblesort(int A[], int n)
{
int i, j;
for(i = n-1 ; i > 0 ; i--)
{ for(j = 0 ; j < i ; j++)
{
if( A[j] > A[j+1] ) SWAP(A[j],A[j+1]);
}
}
}