bacco

Максимален брой комбинации

Feb 27th, 2018
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.92 KB | None | 0 0
  1. using System;
  2.  
  3. namespace dwdwdwdwDD
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             var start = int.Parse(Console.ReadLine());
  10.             var end = int.Parse(Console.ReadLine());
  11.  
  12.             var stop = int.Parse(Console.ReadLine());
  13.             var count = -1;
  14.  
  15.             for (int i = start; i <= end; i++)
  16.             {
  17.                 for (int r = start; r <= end; r++)
  18.                 {
  19.                     count++;
  20.                     if (stop <= count)
  21.                     {
  22.                         continue;
  23.                     }
  24.                     Console.Write($"<{i}-{r}>");
  25.                 }
  26.             }
  27.         }
  28.     }
  29. }
  30. //                          Максимален брой комбинации  
  31.  
  32. //                          1
  33. //                          4
  34. //                          5
  35.  
  36. //                          <1-1><1-2><1-3><1-4><2-1>
Advertisement
Add Comment
Please, Sign In to add comment