7일차 switch 문의 사용 (3)

Console Programming/C# Console 2019. 9. 26. 09:46
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace Syntax19
{
    class Program
    {
        static void Main(string[] args)
        {
            string input = Console.ReadLine().ToUpper();
 
            switch (input)
            {
                case "A":
                    {
                        Console.WriteLine("90 ~ 100");
                        break;
                    }
                case "B":
                    {
                        Console.WriteLine("80 ~ 89");
                        break;
                    }
                case "C":
                    {
                        Console.WriteLine("70 ~ 79");
                        break;
                    }
                case "D":
                    {
                        Console.WriteLine("60 ~ 69");
                        break;
                    }
                case "F":
                    {
                        Console.WriteLine("0");
                        break;
                    }
 
            }
        }
    }
}
 
http://colorscripter.com/info#e" target="_blank" style="color:#e5e5e5text-decoration:none">Colored by Color Scripter
 

학점 (A,B,C,D,F)를 입력 받아서 점수 범위를 출력하는 프로그램

소문자를 입력받더라도 출력할 수 있도록 ToUpper() 를 사용했다.

 

 

 

'Console Programming > C# Console' 카테고리의 다른 글

7일차 switch문의 사용 (5)  (0) 2019.09.26
7일차 Switch 문의 사용 (4)  (0) 2019.09.26
7일차 switch문의 사용 (2)  (0) 2019.09.26
7일차 switch문의 사용  (0) 2019.09.26
백준 2884 알람 시계  (0) 2019.09.26
: