<em><u>Трассировка вызовов, печатаемых значений и подсчет суммы</u></em>
var
s:integer;
procedure F(n:integer);
begin
Write(' F(',n,') ');
Write(n,' '); s:=s+n;
if n<6 then begin
Write(n); s:=s+n;
F(n+1);
F(n+2);
F(2*n)
end
end;
begin
s:=0;
F(1);
Writeln(#13#10,s)
end.
<em><u>Результат выполнения программы:</u></em>
F(1) 1 1 F(2) 2 2 F(3) 3 3 F(4) 4 4 F(5) 5 5 F(6) 6 F(7) 7 F(10) 10 F(6) 6 F(8) 8 F(5) 5 5 F(6) 6 F(7) 7 F(10) 10 F(6) 6 F(4) 4 4 F(5) 5 5 F(6) 6 F(7) 7 F(10) 10 F(6) 6 F(8) 8 F(4) 4 4 F(5) 5 5 F(6) 6 F(7) 7 F(10) 10 F(6) 6 F(8) 8 F(3) 3 3 F(4) 4 4 F(5) 5 5 F(6) 6 F(7) 7 F(10) 10 F(6) 6 F(8) 8 F(5) 5 5 F(6) 6 F(7) 7 F(10) 10 F(6) 6 F(2) 2 2 F(3) 3 3 F(4) 4 4 F(5) 5 5 F(6) 6 F(7) 7 F(10) 10 F(6) 6 F(8) 8 F(5) 5 5 F(6) 6 F(7) 7 F(10) 10 F(6) 6 F(4) 4 4 F(5) 5 5 F(6) 6 F(7) 7 F(10) 10 F(6) 6 F(8) 8 F(4) 4 4 F(5) 5 5 F(6) 6 F(7) 7 F(10) 10 F(6) 6 F(8) 8
530
Надо " A умножить на A " Например: А = 4 сантиметра . Надо 4 умножить на 4 равно 16 квадратных сантиметров.
#include <iostream>
double Area_circle(double R)
{
static double PI = std::atan(1) * 4;
return PI * (R*R);
}
int main()
{
double r_out, r_in_1, r_in_2, r_in_3;
std::cout << "Enter the radius of the outgoing circles" << std::endl;
std::cin >> r_out;
std::cout << "Enter a radius of 1 inner circle" << std::endl;
std::cin >> r_in_1;
std::cout << "Enter a radius of 2 inner circle" << std::endl;
std::cin >> r_in_2;
std::cout << "Enter a radius of 3 inner circle" << std::endl;
std::cin >> r_in_3;
double S = Area_circle(r_out) - Area_circle(r_in_1) - Area_circle(r_in_2) - Area_circle(r_in_3);
if (S > 0)
{
std::cout << "S == " << S << std::endl;
}
else
{
std::cout << "The inner area of the circles should not be greater than the outer!" << std::endl;
}
system("pause");
return 0;
}
Var a=prompt("Введите число a");
var b=prompt("Введите число b");
var c=0;
c=(Number(a)+Number(b));
alert("Cумма чисел: "+c);
c=(Number(a)*Number(b));
alert("Произведение чисел: "+c); <span>
</span>