Advertisement
Margoshinka

Parallelepiped

Dec 29th, 2021
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.85 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4.  
  5. namespace ex1
  6. {
  7.     class Parallelepiped : Base
  8.     {
  9.         protected internal Parallelepiped() : base()
  10.         {
  11.  
  12.  
  13.         }
  14.  
  15.         protected internal Parallelepiped(int a, int b, int c) : base(a, b, c)
  16.         { if (I1 < 0) I1 = 0;
  17.             if (I2 < 0) I2 = 0;
  18.             if (I3 < 0) I3 = 0;
  19.  
  20.         }
  21.         protected internal int Volume()
  22.         {
  23.             int v = I1 * I2 * I3;
  24.  
  25.             return v;
  26.         }
  27.         protected internal int Square()
  28.         {
  29.             int s = 2*I1 * I2+2*I2 * I3+2*I1*I3;
  30.  
  31.             return s;
  32.         }
  33.         protected internal Parallelepiped Bigger(Parallelepiped p)
  34.         {
  35.  
  36.             if (p.Volume() >= this.Volume()) return p;
  37.             else return this;
  38.            
  39.         }
  40.     }
  41. }
  42.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement