Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace cup
- {
- class Program
- {
- static void Main(string[] args)
- {
- int a = int.Parse(Console.ReadLine());
- int b = int.Parse(Console.ReadLine());
- var count = 0; // bool notNumber = false; (You can use boolean!!!)
- for (int n1 = a; n1 <= b; n1++)
- {
- for (int n2 = a; n2 <= b; n2++)
- {
- for (int n3 = a; n3 <= b; n3++)
- {
- for (int n4 = a; n4 <= b; n4++)
- {
- for (int n5 = a; n5 <= b; n5++)
- {
- if ( a <= n1 &&
- n1 < n2 &&
- n2 < n3 &&
- n3 < n4 &&
- n4 < n5 &&
- n5 <= b )
- {
- count++; // notNumber = true;
- Console.WriteLine($"{n1} {n2} {n3} {n4} {n5}");
- }
- }
- }
- }
- }
- }
- if (count == 0) // if (notNumber == false)
- {
- Console.WriteLine("No");
- }
- }
- }
- }
- // 3 4 5 6 7
- // 3 4 5 6 8
- // 3 4 5 7 8
- // 3 4 6 7 8
- // 3 5 6 7 8
- // 4 5 6 7 8
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement