반응형
SMALL
팰린드롬 알고리즘

using System;
using System.Linq;
namespace BOJ00
{
internal class App1
{
public App1()
{
string str = Console.ReadLine();
//여기서 부터 작성하세요
string newStr;
string end = "끝";
while(str != end)
{
str = Console.ReadLine();
newStr = new string(str.Reverse().ToArray());
if (str == newStr)
Console.WriteLine(1 + "\n");
else
Console.WriteLine(0 + "\n");
}
}
}
}
결과창

반응형
LIST
'Algorithm > BOJ' 카테고리의 다른 글
| [BOJ] 11659 구간 합 구하기 4 C# 풀이 (0) | 2023.01.18 |
|---|---|
| [백준] 1차원 배열 전체 합 구하기 C# 사용 (1) | 2023.01.18 |
| [알고스팟] 록 페스티벌 C# 문제 풀이 (0) | 2023.01.17 |
| [BOJ] 1181 단어 정렬 C# 이용 (1) | 2023.01.12 |
| [BOJ] 10173 니모를 찾아서 C# 이용 (0) | 2023.01.12 |