Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace maxGraf
- {
- class Program
- {
- static void Main(string[] args)
- {
- bool visited;
- int counter = 0;
- List<List<int>> Graf = new List<List<int>>();
- // [0]
- Graf.Add(new List<int> { 4, 5 });
- // [1]
- Graf.Add(new List<int> { 4, 5, 6 });
- // [2]
- Graf.Add(new List<int> { 4 });
- // [3]
- Graf.Add(new List<int> { 6, 7 });
- // [4]
- Graf.Add(new List<int> { 0, 1, 2 });
- // [5]
- Graf.Add(new List<int> { 0, 1 });
- // [6]
- Graf.Add(new List<int> { 1, 3 });
- // [7]
- Graf.Add(new List<int> { 3 });
- foreach (List<int> subList in Graf)
- {
- Console.Write("[{0}] - ", counter);
- foreach (int item in subList)
- {
- Console.Write(item + " ");
- }
- Console.WriteLine("\n");
- counter++;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement