남영운 :: 시험범위 출력(19.09.24)

시험범위 출력(19.09.24)

Console(콘솔)/실습 2019. 9. 24. 10:51
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
48
49
50
51
52
53
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace Syntax07
{
    class Program
    {
        static void Main(string[] args)
        {
            //int n = int.Parse(Console.ReadLine());
            for (int a = 1; a > 0; a++)
            {
                Console.Write("입력 : ");
                string str = Console.ReadLine();
                int input = int.Parse(str);
                    if (input >= 90&&input <=100)
                    {
                        Console.WriteLine("출력:  A");
 
                    }
                    else if (input >= 80&&input <90)
                    {
                        Console.WriteLine("출력:  B");
 
                    }
                    else if (input >= 70&&input <80)
                    {
                        Console.WriteLine("출력:  C");
 
                    }
                    else if (input >= 60&&input<70)
                    {
                        Console.WriteLine("출력:  D");
 
                    }
                    else if(input <60)
                    {
                        Console.WriteLine("출력:  F");
 
                    }
                else
                {
                    Console.WriteLine("잘못 입력하셧습니다.");
                    continue;
                }
            }
        }
    }
}
 
 
 

: