Advertisement
Guest User

Untitled

a guest
Mar 19th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7.  
  8. namespace maxGraf
  9. {
  10. class Program
  11. {
  12. static void Main(string[] args)
  13. {
  14. bool visited;
  15. int counter = 0;
  16. List<List<int>> Graf = new List<List<int>>();
  17.  
  18. // [0]
  19. Graf.Add(new List<int> { 4, 5 });
  20. // [1]
  21. Graf.Add(new List<int> { 4, 5, 6 });
  22. // [2]
  23. Graf.Add(new List<int> { 4 });
  24. // [3]
  25. Graf.Add(new List<int> { 6, 7 });
  26. // [4]
  27. Graf.Add(new List<int> { 0, 1, 2 });
  28. // [5]
  29. Graf.Add(new List<int> { 0, 1 });
  30. // [6]
  31. Graf.Add(new List<int> { 1, 3 });
  32. // [7]
  33. Graf.Add(new List<int> { 3 });
  34.  
  35. foreach (List<int> subList in Graf)
  36. {
  37. Console.Write("[{0}] - ", counter);
  38.  
  39. foreach (int item in subList)
  40. {
  41. Console.Write(item + " ");
  42. }
  43.  
  44. Console.WriteLine("\n");
  45. counter++;
  46. }
  47. }
  48. }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement