51
1
using System;
2
3
public class Box
4
{
5
public int Height { get; set; }
6
public int Width { get; set; }
7
8
public Box(int h, int w)
9
{
10
Height = h;
11
Width = w;
12
}
13
14
public static Box operator +(Box box1, Box box2)
15
{
16
int h = box1.Height + box2.Height;
17
int w = box1.Width + box2.Width;
18
Box result = new Box(h, w);
19
return result;
20
}
21
22
public static Box operator +(Box box1, int num)
23
{
24
int h = box1.Height + num;
Cached Result
Printing dotted line
----------------------------------
Printing symbol
##################################################
Printing line
___________________________________