글
C# paiza 72 - 표준 라이브러리
프로그래밍
2020. 5. 22. 22:49
728x90
SMALL
// 標準ライブラリを使ってみよう
using System;
using System.Collections.Generic;
class Lesson08
{
public static void Main()
{
var team = new List<string>();
// Add()
team.Add("勇者");
team.Add("戦士");
team.Add("魔法使い");
foreach (var member in team)
{
Console.WriteLine(member);
}
Console.WriteLine();
// Insert()
team.Insert(2,"忍者");
foreach (var member in team)
{
Console.WriteLine(member);
}
Console.WriteLine();
// Remove()
team.Remove("戦士");
foreach (var member in team)
{
Console.WriteLine(member);
}
}
}
728x90
'프로그래밍' 카테고리의 다른 글
C# paiza 74 - 딕셔너리2 (0) | 2020.05.22 |
---|---|
C# paiza 73 - 딕셔너리(Dictionary)1 (0) | 2020.05.22 |
C# paiza 71 - NameSpace (0) | 2020.05.19 |
C# paiza 70 - 오버로드2 (0) | 2020.05.19 |
C# paiza 69 - 오버로드1 (0) | 2020.05.19 |