Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.11 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4.  
  5. namespace @static
  6. {
  7.     class Program
  8.     {
  9.         class Punkt
  10.         {
  11.             protected double x;
  12.             protected double y;
  13.  
  14.             public double X
  15.             {
  16.                 get
  17.                 {
  18.                     return x;
  19.                 }
  20.                 set
  21.                 {
  22.                     x = value;
  23.                 }
  24.             }
  25.             public double Y
  26.             {
  27.                 get
  28.                 {
  29.                     return y;
  30.                 }
  31.                 set
  32.                 {
  33.                     y = value;
  34.                 }
  35.             }
  36.             public Punkt(double x, double y)
  37.             {
  38.                 this.x = x;
  39.                 this.y = y;
  40.             }
  41.             public Punkt()
  42.                 : this(0, 0)
  43.             {
  44.             }
  45.         }
  46.         static void Main(string[] args)
  47.         {
  48.             Punkt p1 = new Punkt(-10, 100);
  49.             Console.WriteLine(p1.X + " " + p1.Y);
  50.             Console.ReadLine();
  51.         }
  52.     }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement