반응형
코드 전문
using System;
using System.Collections.Generic;
using System.Text;
namespace baek2
{
class Program
{
public static void Main()
{
string[] token = Console.ReadLine().Split();
int n = int.Parse(token[0]);
int m = int.Parse(token[1]);
Dictionary<string, string> dic = new Dictionary<string, string>();
StringBuilder sb = new StringBuilder();
for(int i = 1; i<=n;i++)
{
string[] token2 = Console.ReadLine().Split();
string name = token2[0];
string password = token2[1];
dic.Add(name, password);
}
for (int i = 0; i<m;i++)
{
string s = Console.ReadLine();
sb.AppendLine(dic[s]);
}
Console.WriteLine(sb.ToString());
}
}
}
반응형
'코딩테스트 준비 > 백준 C#' 카테고리의 다른 글
백준 C# - 1987 (0) | 2024.03.12 |
---|---|
백준 C# - 11725 +) 풀이 (0) | 2024.03.04 |
백준 C# - 1620 +) 풀이 (0) | 2024.02.24 |
백준 C# - 7785 (1) | 2024.02.24 |
백준 C# - 1920 +) 풀이 (0) | 2024.02.24 |
댓글