본문 바로가기
알고리즘/백준 BOJ

[BOJ C#] 1259 팰린드롬수

by 왹져박사 2023. 1. 26.
728x90

using System;
using System.Linq;
using System.Text;
using System.IO;

namespace _1259
{
    class Program
    {
        static void Main()
        {
            StreamReader sr = new StreamReader(Console.OpenStandardInput());
            StreamWriter sw = new StreamWriter(Console.OpenStandardOutput());
            StringBuilder sb = new StringBuilder();


            while (true)
            {
                string str = sr.ReadLine();
                if (str == "0")
                    break;
                string strReverse = new string(str.Reverse().ToArray());
                if (str == strReverse)
                    sb.Append("yes\n");
                else
                    sb.Append("no\n");
            }
            sw.WriteLine(sb);

            sr.Close();
            sw.Flush();
            sw.Close();
        }
    }
}

728x90

'알고리즘 > 백준 BOJ' 카테고리의 다른 글

[BOJ C#] 1439 뒤집기  (0) 2023.01.28
[BOJ C#] 5585 거스름돈  (0) 2023.01.27
[BOJ C#] 1085 직사각형에서 탈출  (0) 2023.01.25
[BOJ C#] 4153 직각삼각형  (0) 2023.01.25
[BOJ C#] 10250 ACM 호텔  (0) 2023.01.25