[백준] C# : 성택이의 은밀한 비밀번호 (25372번)

ssu_hyun·2022년 8월 1일
0

Data Structure & Algorithm

목록 보기
43/67
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Baekjoon
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());

            for (int i=0; i < n; i++)
            {
                string s = Console.ReadLine();
                if (s.Length >= 6 && s.Length <= 9)
                {
                    Console.WriteLine("yes");
                }
                else
                {
                    Console.WriteLine("no");
                }
            }
        }
    }
}
  • string.Length : 붙어있는 문자열의 길이 반환
  • Array로 받아 Split하는 방법은 띄어쓰기가 없을 경우 문자열을 묶어서 하나로 본다.

0개의 댓글