View difference between Paste ID: Lsn11d6G and gzdhLcxw
SHOW: | | - or go back to the newest paste.
1
using System;
2
 
3
namespace Kalucki4_5
4
{
5-
    class Program
5+
    public class Program
6
    {
7-
        static void Main(string[] args)
7+
        public static void Main(string[] args)
8
        {
9-
			Kwadrat kw = new Kwadrat(5);
9+
            Kwadrat kw = new Kwadrat(5);
10
            Console.WriteLine(kw.ToString());
11
        }
12
    }
13
 
14
    public interface IFigura
15
    {
16
        int Obwod { get; }
17
        int Pole { get; }
18
    }
19
 
20
    public class Kwadrat : IFigura
21
    {
22
        private int dlBoku;
23-
23+
24-
		public Kwadrat(int dlBoku)
24+
        public Kwadrat(int dlBoku)
25-
	    {
25+
26-
        	this.dlBoku = dlBoku;
26+
            this.dlBoku = dlBoku;
27-
    	}
27+
28
 
29-
        public int Obwod 
29+
        public int Obwod
30-
		{
30+
31-
            get => 4 * dlBoku;
31+
            get 
32-
		}
32+
			{
33
				return 4 * dlBoku;
34-
        public int Pole 
34+
			}
35-
		{
35+
36-
            get => dlBoku * dlBoku;
36+
37-
		}
37+
        public int Pole
38-
38+
39
            get
40
			{
41
				return dlBoku * dlBoku;
42
			}
43
        }
44
 
45
        public override string ToString()
46
        {
47
            return "Kwadrat: " + dlBoku.ToString();
48
        }
49
    }
50
}