티스토리 뷰

딱히 별 생각을 가지고 안해서..

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);


공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/07   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
글 보관함