aggressiveviking

Untitled

Feb 18th, 2020
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.86 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _05.ChallengeTheWedding
  4. {
  5.     class ChallengeTheWedding
  6.     {
  7.         static void Main(string[] args)
  8.         {            
  9.             int totalMen = int.Parse(Console.ReadLine());
  10.             int totalWomen = int.Parse(Console.ReadLine());
  11.             int maxTables = int.Parse(Console.ReadLine());
  12.            
  13.             int tablesCounter = 0;
  14.  
  15.             for (int menDating = 1; menDating <= totalMen; menDating++)
  16.             {
  17.                 for (int womenDating = 1; womenDating <= totalWomen; womenDating++)
  18.                 {
  19.                     tablesCounter++;
  20.  
  21.                     if (tablesCounter > maxTables)
  22.                     {
  23.                         break;
  24.                     }
  25.  
  26.                     Console.Write($"({menDating} <-> {womenDating}) ");
  27.                 }
  28.             }
  29.  
  30.         }
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment