Skip to content

Instantly share code, notes, and snippets.

View RPVUnityDeveloper's full-sized avatar

RPV RPVUnityDeveloper

View GitHub Profile
class Program
{
static void Main()
{
int number = ReadInt();
Console.WriteLine($"Вы ввели число: {number}");
}
static int ReadInt()
@RPVUnityDeveloper
RPVUnityDeveloper / gist:cd1f6f82c68b56999e857c687f50644d
Last active November 3, 2025 19:43
Скобочное выражение
class Program
{
static void Main()
{
int depth = 0;
int maxDepth = 0;
bool isCorrect = true;
char openBracket = '(';
@RPVUnityDeveloper
RPVUnityDeveloper / gist:b806eb8853dc8183478737f2cb9fb110
Last active November 3, 2025 18:57
Сдвиг значений массива
class Program
{
static void Main()
{
int[] numbers = { 1, 2, 3, 4, 5 };
int shift;
int length;
Console.WriteLine("Исходный массив:");
class Program
{
static void Main()
{
Console.Write("Введите текст: ");
string text = Console.ReadLine();
string[] words = text.Split(' ');
Console.WriteLine("\nСлова в тексте:");
@RPVUnityDeveloper
RPVUnityDeveloper / gist:2e6536a5e0e68f93f5b1278d1542ac30
Created November 3, 2025 08:05
Сортировка чисел
class Program
{
static void Main()
{
int size = 10;
int minValue = 0;
int maxValue = 100;
int[] numbers = new int[size];
@RPVUnityDeveloper
RPVUnityDeveloper / gist:a230dcdb500b8f64b903a43661f77c5d
Created November 3, 2025 08:01
Подмассив повторений чисел
class Program
{
static void Main()
{
int size = 30;
int minValue = 0;
int maxValue = 10;
int currentCount = 1;
int maxCount = 1;
@RPVUnityDeveloper
RPVUnityDeveloper / gist:ecea83e8a3e90fb25078a0d78734ad55
Last active November 3, 2025 16:38
Локальные максимумы
using System;
class Program
{
static void Main()
{
int size = 30;
int minValue = 0;
int maxValue = 100;
@RPVUnityDeveloper
RPVUnityDeveloper / gist:0aa7f71e1bf026152632b1ac5c0c6544
Last active November 3, 2025 14:24
Наибольший элемент
using System;
class Program
{
static void Main()
{
int rows = 10;
int cols = 10;
int minValue = 0;
int maxValue = 10;
@RPVUnityDeveloper
RPVUnityDeveloper / gist:f82a264ac42a073db004f072b988e9df
Last active November 3, 2025 07:56
Работа с конкретными строками/столбцами
class Program
{
static void Main()
{
int[,] matrix =
{
{ 2, 3, 4, 5 },
{ 6, 7, 8, 9 },
{ 1, 2, 3, 4 }
};
class Program
{
static void Main()
{
const string CommandAttack = "1";
const string CommandFirebool = "2";
const string CommandExplode = "3";
const string CommandHeal = "4";
int heroHealth = 100;