Advertisement
Spocoman

Cone

Oct 6th, 2024
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.35 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4.   "fmt"
  5.   "math"
  6. )
  7.  
  8. func main() {
  9.     var radius, height float64
  10.     fmt.Scanln(&radius)
  11.     fmt.Scanln(&height)
  12.    
  13.     volume := math.Pi * radius * radius * height / 3
  14.     area := math.Pi * radius * (radius + math.Sqrt(radius * radius + height * height))
  15.  
  16.     fmt.Printf("volume = %.4f\narea = %.4f\n", volume, area)
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement