'전체 글'에 해당되는 글 43건

  1. 2019.09.27 백준 1330번
  2. 2019.09.27 백준 1110번
  3. 2019.09.26 백준 10951번
  4. 2019.09.26 두수를 입력받아 변수에 담기
  5. 2019.09.26 백준 5622번
  6. 2019.09.26 백준 9655번

백준 1330번

Console(콘솔)/알고리즘 2019. 9. 27. 10:55

using System;

 

 

namespace Syntax12

{

    class Program

    {

        static void Main(string[] args)

        {

            string str = Console.ReadLine();

            string[] strr = str.Split(' ');

            int A = int.Parse(strr[0].ToString());

            int B = int.Parse(strr[1].ToString());

            if (A > B)

            {

                Console.WriteLine(">");

            }

            else if (A < B)

            {

                Console.WriteLine("<");

            }

            else

            {

                Console.WriteLine("==");

            }

        }

    }

}

 

 

 

'Console(콘솔) > 알고리즘' 카테고리의 다른 글

백준 2739번  (0) 2019.09.27
백준 10817번  (0) 2019.09.27
백준 1110번  (0) 2019.09.27
백준 10951번  (0) 2019.09.26
백준 5622번  (0) 2019.09.26
:

백준 1110번

Console(콘솔)/알고리즘 2019. 9. 27. 10:34

using System;

 

 

namespace Syntax12

{

    class Program

    {

        static void Main(string[] args)

        {

            int num = int.Parse(Console.ReadLine());

 

            int cnt = 1;

            int chk = num;

            while (true)

            {

                int a = num / 10;

                int b = num % 10;

                int c = a + b;

                num = b * 10 + c % 10;

 

                if (num == chk)

                    break;

                else

                {

                    cnt++;

                }

            }

            Console.WriteLine(cnt);

 

        

        }

    }

}

 

 

'Console(콘솔) > 알고리즘' 카테고리의 다른 글

백준 10817번  (0) 2019.09.27
백준 1330번  (0) 2019.09.27
백준 10951번  (0) 2019.09.26
백준 5622번  (0) 2019.09.26
백준 9655번  (0) 2019.09.26
:

백준 10951번

Console(콘솔)/알고리즘 2019. 9. 26. 15:20

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

 

namespace Syntax10

{

    class Program

    {

        static void Main(string[] args)

        {

            string input;

            while ((input = Console.ReadLine()) != null)

            {

                string[] arr = input.Split(' ');

                int a = int.Parse(arr[0].ToString());

                int b = int.Parse(arr[1].ToString());

                Console.WriteLine(a + b);

            }

        }

    }

}

 

 

'Console(콘솔) > 알고리즘' 카테고리의 다른 글

백준 1330번  (0) 2019.09.27
백준 1110번  (0) 2019.09.27
백준 5622번  (0) 2019.09.26
백준 9655번  (0) 2019.09.26
***고양이***  (0) 2019.09.25
:

두수를 입력받아 변수에 담기

Console(콘솔)/실습 2019. 9. 26. 15:04

한줄에 두수를 입력받아 2개의 변수에 담기 (두수사이는 공백)

using System;

 

namespace Syntax12

{

    class Program

    {

        static void Main(string[] args)

        {

            string input = Console.ReadLine();

            string[] arr = input.Split(' ');

            int a = int.Parse(arr[0].ToString());

            int b = int.Parse(arr[1].ToString());

 

        }

    }

}

 

Colored by Color Scripter

 

'Console(콘솔) > 실습' 카테고리의 다른 글

method문 사용  (0) 2019.09.30
enum 문제  (0) 2019.09.27
switch 예제문  (0) 2019.09.26
숫자 입력, 날짜 출력  (0) 2019.09.26
보기 문제의 정답 입력,출력  (0) 2019.09.26
:

백준 5622번

Console(콘솔)/알고리즘 2019. 9. 26. 14:50

using System;

 

 

namespace Syntax

{

    class Program

    {

        static void Main(string[] args)

        {

            string input = Console.ReadLine();

            int result = 0;

           

            for ( int i = 0; i<input.Length ; i++)

            {              

                char count = input[i];

                

 

                switch (count)

                {

                    case 'A':

                    case 'B':

                    case 'C':

                        result += 3;

                        break;

                    case 'D':

                    case 'E':

                    case 'F':

                        result += 4;

 

                        break;

                    case 'G':

                    case 'H':

                    case 'I':

                        result += 5;

 

                        break;

                    case 'J':

                    case 'K':

                    case 'L':

                        result += 6;

                        break;

                    case 'M':

                    case 'N':

                    case 'O':

                        result += 7;

                        break;

                    case 'P':

                    case 'Q':

                    case 'R':

                    case 'S':

                        result += 8;

                        break;

                    case 'T':

                    case 'U':

                    case 'V':

                        result += 9;

                        break;

                    case 'W':

                    case 'X':

                    case 'Y':

                    case 'Z':

                        result += 10;

                        break;

                    

                }

            }

            Console.WriteLine(result);

 

 

 

 

        }

    }

}

 

 

'Console(콘솔) > 알고리즘' 카테고리의 다른 글

백준 1110번  (0) 2019.09.27
백준 10951번  (0) 2019.09.26
백준 9655번  (0) 2019.09.26
***고양이***  (0) 2019.09.25
***a x b의 값***  (0) 2019.09.25
:

백준 9655번

Console(콘솔)/알고리즘 2019. 9. 26. 11:39

          using System;

 

namespace Syntax

{

    class Program

    {

        static void Main(string[] args)

        {

            int input = int.Parse(Console.ReadLine());

            Console.Clear();

            bool condition = input % 2 == 1;

 

            if (condition)

            {

                Console.WriteLine("SK");

            }

            else

            {

                Console.WriteLine("CY");

            }

        }

    }

}

 

Colored by Color Scripter

'Console(콘솔) > 알고리즘' 카테고리의 다른 글

백준 10951번  (0) 2019.09.26
백준 5622번  (0) 2019.09.26
***고양이***  (0) 2019.09.25
***a x b의 값***  (0) 2019.09.25
***a-b 의 값***  (0) 2019.09.25
:
◀ PREV : [1] : [2] : [3] : [4] : [5] : [6] : [7] : [8] : NEXT ▶