Skip to content

Instantly share code, notes, and snippets.

int[] numbers = new int[] { 1, 3, 5, 7, 11, 13, 17 };
int[] squares = new int[numbers.Length];
int ni = 0;
int si = 0;
for (int i = 0; i < numbers.Length; i++) {
squares[i] = numbers[i] * numbers[i];
}
bool[] thimbles = new bool[3] { false, true, false };
Console.WriteLine("Игра в наперстки");
Console.WriteLine();
Console.WriteLine("[1] [2] [3]");
Console.WriteLine();
Console.WriteLine("под одним из трех наперстков находится шарик. Попробуйте угадать в каком!");
Console.WriteLine();
Console.Write("Введите ваше число от 1 до 3: ");
int input = Convert.ToInt32(Console.ReadLine());
@EntaltsevSN
EntaltsevSN / gist:a9c853ddba6e3afcc223f16f199c5bbd
Created September 18, 2023 20:01
You got dam right! Or not...
int magicNumber = 4;
Console.WriteLine("Угадай число");
Console.WriteLine();
Console.WriteLine("Загадано число от 1 до 5. Попробуйте его отгадать!");
Console.WriteLine();
Console.Write("Введите ваше число: ");
int input = Convert.ToInt32(Console.ReadLine());
Console.WriteLine();
if (input == magicNumber)
Console.Write("Введите своё имя: ");
string name = Console.ReadLine();
Console.WriteLine();
Console.Write("Введите свой возраст: ");
string age = Console.ReadLine();
Console.WriteLine();
string stringNumber = "256";
int numberFromString = Convert.ToInt32(stringNumber);
int square = numberFromString * numberFromString;
Console.WriteLine("Квадрат введенного числа равен " + square);
string s1 = "Каждый ";
string s2 = "охотник ";
string s3 = "желает ";
string s4 = "знать, ";
string s5 = "где ";
string s6 = "сидит ";
string s7 = "фазан.";
Console.Write(s1);
Console.Write(s2);
Console.WriteLine("4 плюс 6 = " + (4 + 6));
Console.WriteLine("4 уменьшенное на 1 = " + (4 - 1));
Console.WriteLine("3 умножить на 7 = " + (3 * 7));
Console.WriteLine("16 разделить на 8 = " + (16 / 8));
Console.WriteLine("11 разделить на 5 = " + (11 / 5f));
Console.WriteLine("целая часть от деления 13 на 3 = " + (13 / 3));
Console.WriteLine("остаток от деления 17 на 8 = " + (17 % 8));
sbyte a = -99;
ushort b = 55555;
uint c = 2394672295;
float d = 65.46f;
char e = 'a';
string f = "World";
string name;
int age;
int programCount;
int money;
int time;
bool truth;
name = "Станислав";
age = 33;
programCount = 2;
2021/04/05 15:45:40 [error] [system] #system @system-exception: array (
'code' => 0,
'message' => 'Invalid amount value type',
'file' => 'D:\\CrowdRepublic\\OpenServer\\domains\\yii-stage\\protected\\components\\lib\\Model\\MonetaryAmount.php',
'line' => 97,
'trace' =>
array (
0 =>
array (
'file' => 'D:\\CrowdRepublic\\OpenServer\\domains\\yii-stage\\protected\\components\\lib\\Common\\AbstractObject.php',