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
|
#include <iostream>
int main()
{
if (0 <= a && a <= 100)
{
if (90 <= a && a <= 100)
{
std::cout << "A\n";
}
else if (80 <= a && a <= 89)
{
std::cout << "B\n";
}
else if (70 <= a && a <= 79)
{
std::cout << "C\n";
}
else if (60 <= a && a <= 69)
{
std::cout << "D\n";
}
else
{
std::cout << "F\n";
}
}
return 0;
}
|
http://colorscripter.com/info#e" target="_blank" style="text-decoration:none;color:white">cs |
1
2
3
4
5
6
7
8
9
|
#include <iostream>
int main()
{
int a = 0;
std::cin >> a;
printf(a > 89 ? "A\n" : a > 79 ? "B\n" : a > 69 ? "C\n" : a > 59 ? "D\n" : "F");
return 0;
}
http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4ftext-decoration:none">Colored by Color Scripter
|
http://colorscripter.com/info#e" target="_blank" style="text-decoration:none;color:white">cs |
'프로그래밍 > 알고리즘' 카테고리의 다른 글
백준 10817 세수 (0) | 2019.08.21 |
---|---|
버블소팅 (0) | 2019.08.21 |
백준 2884 알람 시계 (0) | 2019.08.20 |
백준 2753 윤년 (0) | 2019.08.20 |
백준 1008 (0) | 2018.07.23 |