Advertisement
Margoshinka

base

Dec 29th, 2021 (edited)
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.24 KB | None | 0 0
  1. //базовый класс
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Text;
  5.  
  6. namespace ex1
  7. {
  8.     class Base
  9.     {
  10.  
  11.         int i1;
  12.         int i2;
  13.         int i3;
  14.        
  15.         protected internal int I1
  16.         {
  17.             get { return i1; }
  18.             set
  19.             {
  20.                 i1 = value;
  21.                
  22.             }
  23.  
  24.         }
  25.         protected internal int I2
  26.         {
  27.             get { return  i2; }
  28.             set
  29.             {
  30.                  i2 = value;
  31.                
  32.             }
  33.  
  34.         }
  35.         protected internal int I3
  36.         {
  37.             get { return i3; }
  38.             set
  39.             {
  40.                 i3 = value;
  41.                
  42.             }
  43.         }
  44.  
  45.         protected internal Base()
  46.         {
  47.              Random rnd = new Random();
  48.             I1 = rnd.Next(0, 24);
  49.            I2 = rnd.Next(0, 60);
  50.            I3 = rnd.Next(0, 60);
  51.  
  52.         }
  53.  
  54.         protected internal Base(int a, int b, int c)
  55.         {
  56.             I1 = a;
  57.             I2 = b;
  58.             I3 = c;
  59.         }
  60.  
  61.  
  62.  
  63.         public override string ToString()
  64.         {
  65.             return i1.ToString() + " " + i2.ToString() + " " + i3.ToString() + " ";
  66.  
  67.         }
  68.     }
  69. }
  70.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement