#include <iostream>
#include <math.h>
using namespace std;
int Calc(int ch, int step)
{
int result = pow(ch, step);
return result;
}
int main()
{
int ch, step, result;
cout « "Enter number: "; cin » ch;
cout « "Enter step: "; cin » step;
result = Calc(ch, step);
cout « endl « "Result = " « result « endl;
return 0;
}
Var
a, b: integer;
begin
Write('Введите через пробел делимое и делитель: ');
Readln(a, b);
Writeln(a, '/', b, '=', a div b, ', остаток ', a mod b)
end.
Тестовое решение:
Введите через пробел делимое и делитель: 1564 137
1564/137=11, остаток 57
Ответ:
program pred;
var
n, i, s: Integer;
begin
Write ('Введите N: ');
ReadLn (n);
s := 0;
i := 1;
while i <= n do begin
if i mod 2 = 0 then
s := s + i;
Inc (i);
end;
WriteLn ('Сумма = ', s);
ReadLn;
end.
- - - - - - - - - - - - - -
program post;
var
n, i, s: Integer;
begin
Write ('Введите N: ');
ReadLn (n);
s := 0;
i := 1;
repeat
if i mod 2 = 0 then
s := s + i;
Inc (i);
until i > n;
WriteLn ('Сумма = ', s);
ReadLn;
end.
Ответ:
Г
Объяснение:
В электронное письмо можно добавить абсолютно любой файл