drunin89

Battles

Nov 24th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.98 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Battles
  8. {
  9.     class Battles
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int n1 = int.Parse(Console.ReadLine());
  14.             int n2 = int.Parse(Console.ReadLine());
  15.             int maxBattles = int.Parse(Console.ReadLine());
  16.             int counter = 0;
  17.             if (maxBattles == 0 || maxBattles<0)
  18.             {
  19.  
  20.             }
  21.             else
  22.             {
  23.                 for (int i = 1; i <= n1; i++)
  24.                 {
  25.                     for (int j = 1; j <= n2; j++)
  26.                     {
  27.                         if (counter >= maxBattles)
  28.                         {
  29.                             break;
  30.                         }
  31.                         Console.Write("({0} <-> {1}) ", i, j);
  32.                         counter += 1;
  33.  
  34.                     }
  35.                 }
  36.  
  37.             }
  38.  
  39.         }
  40.     }
  41. }
Add Comment
Please, Sign In to add comment