Skip to content

Instantly share code, notes, and snippets.

@Sprite105
Created November 26, 2015 09:10
Show Gist options
  • Save Sprite105/7d8660f462116862f861 to your computer and use it in GitHub Desktop.
Save Sprite105/7d8660f462116862f861 to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication6
{
public class Class1 {
int[,] mas = { {1,1,1,1,1},
{0,1,1,1,1},
{1,1,1,1,1},
{0,0,0,1,0},
{0,0,0,0,1} };
public void sv() {
int count = 0;
for (int i = 0; i < 5; i++)
{
for (int j = 0; j < 5; j++)
if (mas[i, j] == 1) count++;
if (count == 5) Console.WriteLine("Граф связной !\n"); count = 0;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment