Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Prov
- {
- public class A
- {
- public int a = 5, b = 5, i = 0;
- public int c
- {
- get
- {
- a += a;
- --b;
- i++;
- return
- i * (a - b);
- }
- set
- {
- c = value;
- }
- }
- }
- class programm
- {
- public static void Main()
- {
- B myB = new B();
- for (int i = 0; i < myB.k; i++)
- {
- Console.WriteLine(myB[i]);
- }
- Console.WriteLine(C.St.x);
- Console.ReadLine();
- }
- }
- public class B : A
- {
- public int[] mass;
- public int k;
- public B() : base()
- {
- mass = new int[a];
- k = a;
- }
- public int this[int i]
- {
- get
- {
- return c;
- }
- set
- {
- mass[i] = value;
- }
- }
- }
- public class C
- {
- public struct St
- {
- public static int x = 20;
- }
- }
- }
Add Comment
Please, Sign In to add comment