MiroslavKisov

Max_Combination

Aug 2nd, 2017
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.90 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 Max_Combination
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int begin = int.Parse(Console.ReadLine());
  14.             int end = int.Parse(Console.ReadLine());
  15.             int stop = int.Parse(Console.ReadLine());
  16.             int counter = 0;
  17.             for (int i = begin; i <= end; i++)
  18.             {
  19.                 if (counter == stop)
  20.                 {
  21.                     break;
  22.                 }
  23.                 for (int k = begin; k <= end; k++)
  24.                 {
  25.                     Console.Write("<{0}-{1}>", i, k);
  26.                     counter++;
  27.                     if (counter==stop)
  28.                     {
  29.                         break;
  30.                     }
  31.                 }
  32.             }
  33.         }
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment