Advertisement
Daniel_007

06. Challenge the Wedding

Nov 2nd, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.75 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Exam
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int howManyMen = int.Parse(Console.ReadLine());
  10.             int howManyWomen = int.Parse(Console.ReadLine());
  11.             int maxTables = int.Parse(Console.ReadLine());
  12.             int counter = 0;
  13.            
  14.             for(int i = 1; i <= howManyMen; i++)
  15.             {
  16.                 for(int j=1; j <= howManyWomen; j++)
  17.                 {
  18.                     Console.Write($"({i} <-> {j}) ");
  19.                     counter++;
  20.                     if (counter >= maxTables)
  21.                     {
  22.                         return;
  23.                     }
  24.                 }
  25.                
  26.             }
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement