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

[BOJ C#] 10173 니모를 찾아서

by 왹져박사 2023. 1. 12.
728x90
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _10173
{
    class App
    {
        //생성자
        public App()
        {
            //[BOJ] 10173 니모를 찾아서 
            string[] arr = {
                "Marlin names this last egg Nemo, a name that Coral liked.",
                "While attempting to save nemo, Marlin meets Dory,",
                "a good-hearted and optimistic regal blue tang with short-term memory loss.",
                "Upon leaving the East Australian Current,(888*%$^&%0928375)Marlin and Dory",
                "NEMO leaves for school and Marlin watches NeMo swim away."
            };

            //여기서부터 작성 하세요 
            for(int i = 0; i < arr.Length; i++)
            {
                bool foundMissing = StringUpper(arr[i]).Contains("NEMO");

                PrintFoundMissing(foundMissing);
            }


            //출력 
            //Found
            //Found
            //Missing
            //Missing
            //Found
        }

        private string StringUpper(string strs)
        {
            string strUpper = strs.ToUpper();
            return strUpper;
        }
        private void PrintFoundMissing(bool foundMissing)
        {
            if (foundMissing == true)
            {
                Console.WriteLine("Found");
            }
            else
            {
                Console.WriteLine("Missing");
            }
        }
    }
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _10173
{
    class Program
    {
        static void Main(string[] args)
        {
            new App();
        }
    }
}

728x90

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

[BOJ C#] 1181 단어 정렬  (0) 2023.01.12
[BOJ C#] 2711 오타맨 고창영  (0) 2023.01.12
[BOJ C#] 4458 첫 글자를 대문자로  (0) 2023.01.12
[BOJ C#] 9086 문자열  (0) 2023.01.12
[BOJ C#] 괄호 9012 _case1  (0) 2023.01.11