function Hanoi(n: integer): uint64;
begin
if n = 1 then
begin
Result:=1;
exit();
end
else
begin
Result:=2 * Hanoi(n-1) + 1;
end;
end;
begin
writeln(hanoi(64));
end.
#include <iostream>
using namespace std;
int main()
{
double x, y;
cin >> x >> y;
if ((x >= 2) && (y >= (5 * x - 22) / 3) && (y <= (23 - 4 * x) / 3))
cout << "true";
else
cout << "false";
return 0;
}
Const n=10;
var a:array[1..n] of integer;
max,i:integer;
begin
Randomize;
writeln('Исходный массив:');
for i:=1 to n do begin
a[i]:=random(21)-10;
write(a[i],' ');
end;
writeln;
max:=a[1];
for i:=2 to n do
if a[i]>max then max:=a[i];
writeln('max = ',max);
for i:=1 to n do
if a[i]=max then write(i:3);
writeln;
end.
Пример:
Исходный массив:
-6 -9 10 -6 0 0 -8 10 -8 2
max = 10
3 8