М
Молодежь
К
Компьютеры-и-электроника
Д
Дом-и-сад
С
Стиль-и-уход-за-собой
П
Праздники-и-традиции
Т
Транспорт
П
Путешествия
С
Семейная-жизнь
Ф
Философия-и-религия
Б
Без категории
М
Мир-работы
Х
Хобби-и-рукоделие
И
Искусство-и-развлечения
В
Взаимоотношения
З
Здоровье
К
Кулинария-и-гостеприимство
Ф
Финансы-и-бизнес
П
Питомцы-и-животные
О
Образование
О
Образование-и-коммуникации
crissimakova20
crissimakova20
15.07.2020 09:45 •  Информатика

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рочно

👇
Открыть все ответы
Ответ:
kondratenkoari1
kondratenkoari1
15.07.2020
Вообще то, это задача чисто математическая.  Пусть есть трехзначное число abc.
По условию:

   abc
+ abc

   bca
Понятно, что максимальным число будет, если сложение в двух младших разрядах идет через перенос  ->  получим систему уравнений:
2c = a +16
2b +1 = c + 16
2a + 1 = b
равносильная ей система
2с = a + 16
c = 2b - 15
b = 2a + 1
подставляем третье во второе, получаем первые два уравнения
2с = a + 16
c = 4a - 13   из этих двух уравнений  ->   7a = 42  ->  a = 6  -> из третьего уравнения  b = 13
13 = D(16),   из первого уравнения  с = 22/2 = 11(10) = B(16)
->  abc(16) = 6DB(16) = 1755(10),     DB6(16) = 3510(10)   -> 2abc = bca
4,4(57 оценок)
Ответ:
YuliaPyatova
YuliaPyatova
15.07.2020
Program question;

var
   a: string;
   b: integer;

begin
     writeln('Сколько тебе лет?:');
     readln(b);
     if b > 17 then begin
                                 writeln('В каком институте ты учишься?:');
                                 readln(a);
                                 writeln(a, ' хороший институт');
                                 writeln('До следующей встречи!');
                            end
          else
     if b <= 17 then begin
                                 writeln('В какой школе ты учишься?');
                                 readln(a);
                                 writeln(a, ' не плохая школа');
                                 writeln('До следующей встречи!');
                                 end;
end.
4,5(55 оценок)
Это интересно:
Новые ответы от MOGZ: Информатика
logo
Вход Регистрация
Что ты хочешь узнать?
Спроси Mozg
Открыть лучший ответ