Advertisement
Vitaliy_Novichikhin

4.1.4

Oct 23rd, 2020
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.66 KB | None | 0 0
  1. import math
  2. side = [float(i) for i in input().split()] # сторона квадрата основания
  3. height = [float(i) for i in input().split()] # высота пирамиды
  4.  
  5. volume_pyr = [(float(side[i])**2 * float(height[i]))/3 for i in range(len(side))] # список объёмов пирамид
  6.  
  7. pyr_sq = [2*side[i] * math.sqrt(0.25 * side[i]**2 + height[i]**2) for i in range(len(side))] # площадь поверхности пирамиды
  8.  
  9. # Выведем на экран нужные значения
  10. print("Vmax: %2d, %8.2f, Smin: %2d, %8.2f" % (volume_pyr.index(max(volume_pyr)), max(volume_pyr), pyr_sq.index(min(pyr_sq)), min(pyr_sq)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement