Var
a,b,i:integer;
begin
for i:=0 to 56 do
begin
if i mod 2 = 0 then a:=a-i else a:=a+i;
end;
end.
Var a: integer;
begin
write('Введите трехзначное число: ');
readln(a);
writeln('Результат: ',(a mod 100)*10+(a div 100));
end.
var a,b,c:integer;
begin
writeln('Введите a,b,c');
write('a=');
readln(a);
write('b=');
readln(b);
write('c=');
readln(c);
if a+b>b+c then
begin
if a+b>a+c then
write('a+b=',a+b)
else
write('c+a=',c+a);
end
else if b+c>=a+b then
begin
if b+c>c+a then
write('b+c=',b+c)
else
write('c+a=',c+a);
end
else
write('c+b=',c+b);
end.
function Pow(x, y: real): real;
var
PowTmp: real;
begin
if (x < 0) then
PowTmp := (-1) * Exp(y * Ln(Abs(x)))
else if (x > 0) then
PowTmp := Exp(y * Ln(Abs(x)))
else PowTmp := 0;
if not (odd(round(y))) then PowTmp := Abs(PowTmp);
if (y = 0) then PowTmp := 1;
Pow := PowTmp;
end;
Вот функция, приклейте, куда нужно:)
#include <iostream>
#include <ctime>
int main()
{
using namespace std;
const int SIZE = 25;
int massive[SIZE];
//1й пункт
cout << "Enter number: ";
int num;
cin >> num;
int s = 0;
for (int i = 1; i <= num; i++)
if (num % i == 0)
if (i % 2 == 1)
s = s + i;
cout << "The sum of the odd divisors: " << s << endl;
//2й пункт
for (int i = 0; i < SIZE; i++)
{
cout << "Enter #" << i + 1 << " element: ";
cin >> massive[i];
}
for (int i = 0; i < SIZE; i++)
if (massive[i] < 0)
{
massive[i] = 0;
break;
}
for (int i = 0; i < SIZE; i++)
cout << massive[i] << ' ';
//3й пункт
for (int i = 0; i < SIZE; i++)
massive[i] = i + 1;
for (int i = 0; i < SIZE; i++)
if (massive[i] % 3 == 0)
massive[i] *= massive[2];
cout << endl;
for (int i = 0; i < SIZE; i++)
cout << massive[i] << ' ';
//4й пункт
srand(time(0));
for (int i = 0; i < SIZE; i++)
massive[i] = rand();
cout << endl;
for (int i = 0; i < SIZE; i++)
cout << massive[i] << ' ';
cout << endl;
cout << "Enter number: ";
int num2;
cin >> num2;
bool ifsum = false;
for (int i = 0; i < SIZE - 1; i++)
if (massive[i] + massive[i + 1] == num2)
{
ifsum = true;
break;
}
if (ifsum)
cout << "yes";
else
cout << "no";
cout << endl;
return 0;
}