-
Notifications
You must be signed in to change notification settings - Fork 5
/
P11_5DifferentNumbers.cs
37 lines (33 loc) · 1011 Bytes
/
P11_5DifferentNumbers.cs
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
using System;
namespace P11_5DifferentNumbers
{
class P11_5DifferentNumbers
{
static void Main(string[] args)
{
int startNum = int.Parse(Console.ReadLine());
int endNum = int.Parse(Console.ReadLine());
if (endNum - startNum < 5)
{
Console.WriteLine("No");
return;
}
for (int i = startNum; i <= endNum - 4; i++)
{
for (int j = i + 1; j <= endNum - 3; j++)
{
for (int k = j + 1; k <= endNum - 2; k++)
{
for (int m = k + 1; m <= endNum - 1; m++)
{
for (int n = m + 1; n <= endNum; n++)
{
Console.WriteLine($"{i} {j} {k} {m} {n}");
}
}
}
}
}
}
}
}