초기 커밋.
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
internal class Program
|
||||
{
|
||||
// 구조체 정의
|
||||
struct MyPoint
|
||||
{
|
||||
public int X;
|
||||
public int Y;
|
||||
|
||||
public MyPoint(int x, int y)
|
||||
{
|
||||
this.X = x;
|
||||
this.Y = y;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("({0}, {1})", X, Y);
|
||||
}
|
||||
}
|
||||
|
||||
sealed class MyPointC
|
||||
{
|
||||
public int X;
|
||||
public int Y;
|
||||
|
||||
public MyPointC(int x, int y)
|
||||
{
|
||||
this.X = x;
|
||||
this.Y = y;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("({0}, {1})", X, Y);
|
||||
}
|
||||
}
|
||||
|
||||
private static void Main(string[] args)
|
||||
{
|
||||
// 구조체 사용
|
||||
MyPoint pt = new MyPoint(10, 12);
|
||||
Console.WriteLine(pt.ToString());
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user