Advertisement
BorislavShekerdzhiys

max combination

Nov 29th, 2016
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 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 _06.Max.Combination
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. var begin = int.Parse(Console.ReadLine());
  14. var end = int.Parse(Console.ReadLine());
  15. var maxCombination = int.Parse(Console.ReadLine());
  16. var counter=0;
  17. //var counter2 = 0;
  18.  
  19.  
  20. for (int a = begin; a <= end; a++)
  21. {
  22.  
  23. for (int b = begin; b <= end; b++)
  24. {
  25.  
  26.  
  27. if (counter == maxCombination)
  28. {
  29. break;
  30. }
  31. counter++;
  32. Console.Write("<{0}-{1}>", a , b);
  33. }
  34. }
  35. }
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement