5일차 시험점수를 입력받아 학점으로 출력
Console Programming/C# Console 2019. 9. 24. 11:00논리 연산자 && 나 || 를 사용하지 않고 구성해 보았다.
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;
namespace Syntax11
{
class Program
{
static void Main(string[] args)
{
Console.Write("시험 점수를 입력하세요.");
if (score < 0)
{
Console.WriteLine("0~100사이의 값이 아닙니다.");
}
else if (score <=100)
{
if (score < 60)
Console.WriteLine("F");
else if (score<=69)
{
Console.WriteLine("D");
}
else if (score<=79)
{
Console.WriteLine("C");
}
else if (score <= 89)
{
Console.WriteLine("B");
}
else
{
Console.WriteLine("A");
}
}
else
{
Console.WriteLine("0~100사이의 값이 아닙니다.");
}
}
}
}
http://colorscripter.com/info#e" target="_blank" style="color:#e5e5e5text-decoration:none">Colored by Color Scripter
|
![](https://blog.kakaocdn.net/dn/scB3D/btqywxjUIlv/iQQjGlHmPiubnkB7aAkCb0/img.png)
'Console Programming > C# Console' 카테고리의 다른 글
5일차 세 개의 정수를 입력받아 두번째로 큰 수 출력 (0) | 2019.09.24 |
---|---|
5일차 시험점수를 입력받아 학점으로 출력 (2) 논리연산자 사용 (0) | 2019.09.24 |
성적입력 프로그램 1일차 (0) | 2019.09.23 |
행렬 Col 과 Row를 입력받기 (0) | 2019.09.23 |
행렬 4 x 5 (0) | 2019.09.23 |