//Описание добавить не вышло на сайт, посему - в файле
#include "stdafx.h" #include <conio.h>
void swap(short &a, short &b) { short c = a; a = b;
b = c; }
void sort(short &a, short &b, short &c) { short min = a, max = c; if (min > b) min = b; if (min > c) min = c; if (max < a) max = a; if (max < b) max = b; b = a + b + c - min - max; a = min; c = max; }
if ((a1 == a2) && (b1 == b2) && (c1 == c2)) printf("Boxes are equal"); else if ((a1 <= a2) && (b1 <= b2) && (c1 <= c2)) printf_s("The first box is smaller than the second one"); else if ((a2 <= a1) && (b2 <= b1) && (c2 <= c1)) printf_s("The first box is larger than the second one"); else printf_s("Boxes are incomparable");
=
Объяснение:
const
nmax=100;
type
Tarr=array[1..nmax] of integer;
var
a:Tarr;
i,n:integer;
begin
randomize;
repeat
write('Razmer massiva, ne bolee ',nmax,': ');
readln(n);
until n in [1..nmax];
writeln('Ishodniy massiv:');
for i:=1 to n do
begin
a[i]:=random(50);
write(a[i]:4);
end;
writeln;
i:=1;
while (i<=n) and (a[i] mod 5<>0) do
inc(i);
if i>n then
writeln('Net elementov kratyh 5')
else
begin
a[i]:=0;
writeln('Poluchenniy massiv:');
for i:=1 to n do
write(a[i]:4);
writeln;
end;
end.