Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _01._Unique_PIN_Codes
- {
- class Program
- {
- static void Main(string[] args)
- {
- int firstNum = int.Parse(Console.ReadLine());
- int secondNum = int.Parse(Console.ReadLine());
- int thirthNum = int.Parse(Console.ReadLine());
- bool flagOne = false;
- bool flagTwo = false;
- bool flagThree = false;
- for (int first = 1; first <= firstNum; first++)
- {
- if (first % 2 == 0)
- {
- flagOne = true;
- }
- else
- {
- flagOne = false;
- }
- for (int second = 2; second <= 7; second++)
- {
- if (second == 2)
- {
- flagTwo = true;
- }
- else if (second % 2 == 0)
- {
- flagTwo = false;
- }
- else if (second <= 1)
- {
- flagTwo = false;
- }
- else
- {
- for (int i = 3; i <= second; i += 2)
- {
- if (second <= secondNum)
- {
- if (second % i == 0)
- {
- flagTwo = true;
- }
- else
- {
- flagTwo = false;
- }
- }
- else
- {
- break;
- }
- }
- }
- for (int thirth = 1; thirth <= thirthNum; thirth++)
- {
- if (thirth % 2 == 0)
- {
- flagThree = true;
- }
- else
- {
- flagThree = false;
- }
- if (flagOne)
- {
- if (flagTwo)
- {
- if (flagThree)
- {
- Console.WriteLine($"{first} {second} {thirth}");
- }
- }
- }
- }
- }
- }
- }
- }
- }
RAW Paste Data