AddO1f

LabSh2

May 18th, 2016
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.74 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Prov
  4. {
  5.     public class A
  6.     {
  7.         public int a=2, b=3;
  8.         public int c
  9.         {
  10.             get
  11.             {
  12.                 do
  13.                 {
  14.                     a = a + a;
  15.                     --b;
  16.                 }
  17.                 while
  18.                     (a < 30);
  19.                 return
  20.                     (a - b);
  21.             }
  22.             set
  23.             {
  24.                 c = value;
  25.             }
  26.         }
  27.     }
  28.     class programm
  29.     {
  30.         public static void Main()
  31.         {
  32.             A myB = new A();
  33.             Console.WriteLine(myB.c);
  34.             Console.ReadLine();
  35.         }
  36.     }
  37.     public class B : A
  38.     {
  39.         public B() : base() { }
  40.     }
  41. }
Add Comment
Please, Sign In to add comment