Advertisement
knoteva

Untitled

Nov 3rd, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.96 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _6666.ChallengingTheWedding
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int numMales = int.Parse(Console.ReadLine());
  10.             int numFemales = int.Parse(Console.ReadLine());
  11.             int maxTables = int.Parse(Console.ReadLine());
  12.             int freeTables = maxTables;
  13.  
  14.             if (numMales >= 1 && numMales <= 100 && numFemales >= 1 && numFemales <= 100 && maxTables >= 1 && maxTables <= 100)
  15.             {
  16.  
  17.  
  18.  
  19.                 for (int i = 1; i <= numMales; i++)
  20.                 {
  21.                     for (int j = 1; j <= numFemales; j++)
  22.                     {
  23.                         Console.Write("({0} <-> {1}) ", i, j);
  24.                         freeTables--;
  25.                         if (freeTables <= 0)
  26.                         {
  27.                             break;
  28.                         }
  29.                     }
  30.                 }
  31.  
  32.             }
  33.  
  34.         }
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement