-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChapter10.cs
More file actions
47 lines (37 loc) · 991 Bytes
/
Chapter10.cs
File metadata and controls
47 lines (37 loc) · 991 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using System;
struct Point
{
public int x;
public int y;
}
struct Simple
{
public int x;
public int y;
public Simple(int a, int b)
{
x = a;
y = b;
}
}
namespace Chapter10
{
class Program{
static void MainTest()
{
Point first, second, third;
first.x = 10; first.y = 10;
second.x = 10; second.y = 10;
third.x = first.x + second.x;
third.y = first.y + second.y;
Console.WriteLine("first: {0}, {1}", first.x, first.y);
Console.WriteLine("second: {0}, {1}", second.x, second.y);
Console.WriteLine("third: {0}, {1}", third.x, third.y);
Console.WriteLine("*************************************************");
Simple s1 = new Simple();
Simple s2 = new Simple(5,10);
Console.WriteLine("{0}, {1}", s1.x, s1.y);
Console.WriteLine("{0}, {1}", s2.x, s2.y);
}
}
}