Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace CubeProperties
- {
- class Program
- {
- static void Main(string[] args)
- {
- decimal inputNum = decimal.Parse(Console.ReadLine());
- string inputString = Console.ReadLine();
- CubeProperties(inputNum, inputString);
- }
- private static void CubeProperties(decimal inputNum, string inputString)
- {
- switch (inputString)
- {
- case "face":
- Console.WriteLine("{0:0.00}", Math.Sqrt(2*Math.Pow((double)inputNum, 2)));
- break;
- case "space":
- Console.WriteLine("{0:0.00}", Math.Sqrt(3 * Math.Pow((double)inputNum, 2)));
- break;
- case "volume":
- Console.WriteLine("{0:0.00}", Math.Pow((double)inputNum, 3));
- break;
- case "area":
- Console.WriteLine("{0:0.00}", 6 * (inputNum * inputNum));
- break;
- default:
- break;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement