Advertisement
Spocoman

Cone

Nov 28th, 2021
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.50 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Cone
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             double radius = double.Parse(Console.ReadLine());
  10.             double height = double.Parse(Console.ReadLine());
  11.  
  12.             double volume = Math.PI * radius * radius * height / 3;
  13.             double area = Math.PI * radius * (radius + Math.Sqrt(radius * radius + height * height));
  14.             Console.WriteLine($"volume = { volume:f4}\narea = { area:f4}");
  15.  
  16.         }
  17.     }
  18. }
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement