두번째로 큰 정수가 누구인가 (19.09.24)
Console(콘솔)/실습 2019. 9. 24. 13:34
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Syntax07
{
class Program
{
static void Main(string[] args)
{
for (int i = 1; i > 0; i++)
{
Console.Write("입력 : ");
int a = int.Parse(Console.ReadLine());
Console.WriteLine("A: "+a);
Console.Write("입력 : ");
int b = int.Parse(Console.ReadLine());
Console.WriteLine("B: "+b);
Console.Write("입력 : ");
int c = int.Parse(Console.ReadLine());
Console.WriteLine("C:"+ c);
if (1 <= a && a <= 100)
{
if (1 <= b && b <= 100)
{
if (1 <= c && c <= 100)
{
if (a >= b && a < c)
{
Console.WriteLine("출력 : " + a);
Console.WriteLine();
}
else if (a <= b && a > c)
{
Console.WriteLine("출력 : " + a);
Console.WriteLine();
}
else if (a >= c && a < b)
{
Console.WriteLine("출력 : " + a);
Console.WriteLine();
}
else if (b >= c && b < a)
{
Console.WriteLine("출력 : " + b);
Console.WriteLine();
}
else if (b <= c && b > a)
{
Console.WriteLine("출력 : " + b);
Console.WriteLine();
}
else if (b >= a && b < c)
{
Console.WriteLine("출력 : " + b);
Console.WriteLine();
}
else if (c >= a && c < b)
{
Console.WriteLine("출력 : " + c);
Console.WriteLine();
}
else if (c <= a && c > b)
{
Console.WriteLine("출력 : " + c);
Console.WriteLine();
}
else if (c >= b && c < a)
{
Console.WriteLine("출력 : " + c);
Console.WriteLine();
}
else if(a == b && b == c)
{
Console.WriteLine("출력 : " + a);
Console.WriteLine();
}
}
}
}
else
{
Console.WriteLine("잘못 입력 하셧습니다.");
Console.WriteLine();
}
}
}
}
}
|
'Console(콘솔) > 실습' 카테고리의 다른 글
최대 공약수 구하기(19.09.24) (0) | 2019.09.24 |
---|---|
배수 참/거짓 (19.09.24) (0) | 2019.09.24 |
시험범위 출력(19.09.24) (0) | 2019.09.24 |
상품 구매 갯수 선택 및 재고목록(19.09.23) (0) | 2019.09.23 |
상품 구매 및 판매(19.09.23) (0) | 2019.09.23 |