1.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
using System;
using static System.Console;
namespace Practice2
{
class NameCard
{
public int age { get; set; }
public string name { get; set; }
}
class MainApp
{
public static void Main()
{
NameCard nameCard = new NameCard() { name = "상현", age = 24 };
WriteLine("나이 : {0}", nameCard.age);
WriteLine("이름 : {0}", nameCard.name);
}
}
}
http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4f; text-decoration:none">Colored by Color Scripter
|
http://colorscripter.com/info#e" target="_blank" style="text-decoration:none; color:white">cs |
2.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
using System;
using static System.Console;
namespace Practice2
{
class MainApp
{
public static void Main()
{
var nameCard = new { Name = "박상현", Age = "17" };
WriteLine("이름 : {0}, 나이 : {1}", nameCard.Name, nameCard.Age);
var complex = new { Real = "3", Imaginary = "-12" };
WriteLine("Real : {0}, Imaginary : {1}", complex.Real, complex.Imaginary);
}
}
}
http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4f; text-decoration:none">Colored by Color Scripter
|
http://colorscripter.com/info#e" target="_blank" style="text-decoration:none; color:white">cs |
'Programming Language > 이것이 C# 연습문제 풀이' 카테고리의 다른 글
이것이 C# 11장 연습문제 풀이 (0) | 2019.05.13 |
---|---|
이것이 C# 10장 연습문제 풀이 (0) | 2019.05.13 |
이것이 C# 8장 연습문제 풀이 (0) | 2019.05.13 |
이것이 C# 7장 연습문제 풀이 (0) | 2019.05.11 |
이것이 C# 6장 연습문제 풀이 (0) | 2019.05.09 |