티스토리 뷰
딱히 별 생각을 가지고 안해서..
n개의 파일 이름에 대해서 글자 하나씩 끌고와서 비교하고, 같으면 한글자 append, 다르면 ? append 하였음
int n = int.Parse(sr.ReadLine());
string s = null;
string[] fileName = new string[n];
for (int x = 0; x < n; x++)
fileName[x] = sr.ReadLine();
for(int y = 0; y < fileName[0].Length; y++)
{
s = null;
for(int z = 1; z < n; z++)
{
if (fileName[0][y] != fileName[z][y])
{
s = "?";
break;
}
}
if (s == null)
s = fileName[0][y].ToString();
sb.Append(s);
}
Console.WriteLine(sb);
'■ 알고리즘 > ◻ 백준' 카테고리의 다른 글
| [C#]백준 1316번 : 그룹 단어 체커 (0) | 2018.08.13 |
|---|---|
| [C#]백준 2941번 : 크로아티아 알파벳 (0) | 2018.08.13 |
| [C#]백준 2908번 : 상수 (0) | 2018.08.13 |
| [C#]백준 1159번 : 농구 경기 (0) | 2018.08.13 |
| [C#]백준 12813번 : 이진수 연산 (0) | 2018.08.10 |