nalekseeva62
?>

Mech's spaceship landed on an alien planet. The brave explorer decided to have a walk around. The scenery was very picturesque - huge rocks under the black sky with several moons... Soon he approached an edge of a terrifying hole. He looked down and suddenly saw there one of the planet's moons - the hole went down through the whole planet!! "Abyss..." - Mech whispered in primal awe. He was so impressed that decided to estimate how large the abyss is in comparison with the planet. To start with he wants to calculate the actual volume of the planet i.e. its volume without the space in the abyss. Assume that the planet is a perfect ball and the abyss has the form of a cylinder that is symmetrically cut out of the ball as shown below. The only information Mech managed to get is the depth of the abyss. He now wonders if it is possible to calculate the volume of the ball with the cut out cylinder of the given depth. Help him and write a program to calculate it without knowing the radius of the planet. Don't be surprised - it is really possible! Hint: consider the previous sentence as a hint :)) Input Input will contain only one real number 0<=depth<=100 - the depth of the abyss in megameters. Output Your program should produce only one line with the actual volume of the planet in cubic megameters rounded to three digits after decimal point. Sample input 0.31 Sample output 0.016 cрочно

Информатика

Ответы

Сергеевна-Пузанов
 const nx = 20;
var x: array[1..nx, 1..nx] of integer;z:array[1..nx*2] of integer; 
i, j, k,n,r,t: integer; 
begin 
Writeln('Введите размер матрицы n');Read(n); 
 for i := 1 to n do begin   
for j := 1 to n do begin   
Read(k);x[i, j] := k;  end;end;   
Writeln('Исходный массив'); 
for i := 1 to n do begin   
for j := 1 to n do begin     
Write(x[i, j]:4);     
if x[i, j]>0 then begin t:=t+1; z[t]:=x[i, j];end;    
end;   
Writeln;  end; 
Writeln;Writeln('Одномерный массив'); 
for j := 1 to t do     
Write(z[j]:4); 
 end.

Ответить на вопрос

Поделитесь своими знаниями, ответьте на вопрос:

Mech's spaceship landed on an alien planet. The brave explorer decided to have a walk around. The scenery was very picturesque - huge rocks under the black sky with several moons... Soon he approached an edge of a terrifying hole. He looked down and suddenly saw there one of the planet's moons - the hole went down through the whole planet!! "Abyss..." - Mech whispered in primal awe. He was so impressed that decided to estimate how large the abyss is in comparison with the planet. To start with he wants to calculate the actual volume of the planet i.e. its volume without the space in the abyss. Assume that the planet is a perfect ball and the abyss has the form of a cylinder that is symmetrically cut out of the ball as shown below. The only information Mech managed to get is the depth of the abyss. He now wonders if it is possible to calculate the volume of the ball with the cut out cylinder of the given depth. Help him and write a program to calculate it without knowing the radius of the planet. Don't be surprised - it is really possible! Hint: consider the previous sentence as a hint :)) Input Input will contain only one real number 0<=depth<=100 - the depth of the abyss in megameters. Output Your program should produce only one line with the actual volume of the planet in cubic megameters rounded to three digits after decimal point. Sample input 0.31 Sample output 0.016 cрочно
Ваше имя (никнейм)*
Email*
Комментарий*

Популярные вопросы в разделе

Попов1946
Obukhov-Buriko
kengyra
vgolentsova
vkaloshin
uksusoval617
xachen
Геннадьевич-Тимофеева158
inj-anastasia8
mariashapar
Борисов
Антон
marinamarinyuk39
tretyakovamarina201155
alvs9