silvana1303

secret doors lock

Apr 25th, 2020
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.77 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Loops
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int first = int.Parse(Console.ReadLine());
  10.             int second = int.Parse(Console.ReadLine());
  11.             int third = int.Parse(Console.ReadLine());
  12.  
  13.             for (int i = 1; i <= first; i++)
  14.             {
  15.                 for (int j = 1; j <= second; j++)
  16.                 {
  17.                     for (int k = 1; k <= third; k++)
  18.                     {
  19.                         if ((j == 2 || j == 3 || j ==5 || j == 7) && (i % 2 == 0) && (k % 2 == 0))
  20.                         {
  21.                             Console.WriteLine($"{i} {j} {k} ");
  22.                         }
  23.                     }
  24.                 }
  25.             }
  26.         }
  27.     }
  28. }
Add Comment
Please, Sign In to add comment