Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace Ostroslup
- {
- class Program
- {
- public static void ObjetoscPiramidy(double podstawa, double krawedz)
- {
- if (podstawa < 0 || krawedz < 0)
- {
- Console.WriteLine("ujemne wartości parametrów");
- }
- else if (podstawa == 0)
- {
- Console.WriteLine("nie spełniony warunek trójkąta");
- }
- else
- {
- double score = podstawa * podstawa * Math.Sqrt(krawedz * krawedz - (podstawa * podstawa) / 2) / 3;
- Console.WriteLine(score);
- }
- }
- static void Main(string[] args)
- {
- ObjetoscPiramidy(4, 4);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement