Notice
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 몬스터
- stateauthority
- unity git
- nav오브젝트사이거리
- unity 병합
- networkbehaviourid
- 깃허브 데스크탑 병합
- M590
- 오브젝트 깜빡임
- 유니티 해상도 변경
- 유니티 브랜치 merge
- githubdesktopmerge
- nav거리
- navigation
- networkobject
- NavMesh
- 유니티 합치기
- m585 수리
- m590 수리
- 유니티 머지
- networkobject.networkid
- m585
- 유니티
- Github DeskTop Merge
- Unity
- 유니티 해상도
- unity merge
- 유니티 해상도 설정
- 깃허브 데스크탑 합치기
Archives
- Today
- Total
집게사장의 꿈
백준 C# 9012 괄호 본문
괄호의 짝을 판단하는 문제
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApp1
{
internal class Program
{
static void Main(string[] args)
{
int iter = int.Parse(Console.ReadLine().Trim());
Stack<int> stack = new Stack<int>();
StringBuilder stringBuilder = new StringBuilder();
for (int i = 0; i < iter; i++)
{
string str = Console.ReadLine().Trim();
bool isValid = true;
stack.Clear();
foreach (int c in str)
{
if (c == ('('))
{
stack.Push(c);
}
else if (c == (')'))
{
if (stack.Count == 0)
{
isValid = false;
break;
}
stack.Pop();
}
}
if (stack.Count > 0) isValid = false;
stringBuilder.Append(isValid ? "YES\n" : "NO\n");
}
Console.WriteLine(stringBuilder.ToString());
}
}
}
'기타 > 백준' 카테고리의 다른 글
백준 C# 2475 검증수 (0) | 2024.07.04 |
---|---|
백준 C# 2231 분해합 (0) | 2024.07.04 |
백준 c# 4949 균형잡힌 세상 (0) | 2024.06.09 |
백준 C# 10773 제로 (0) | 2024.06.06 |
백준 C# 28278 스택 2 (0) | 2024.06.06 |