Skip to content

Instantly share code, notes, and snippets.

byte age
short temperatureOutside
ushort heightOfBuilding
uint amountOfCoins
int health
double result
float wheightOfCheese
bool isAbleToMove
string nameOfGuild
char classOfItem
Console.InputEncoding = Encoding.Unicode;
Console.OutputEncoding= Encoding.Unicode;
Console.Write("как вас зовут?");
string name = Console.ReadLine();
Console.Write("Сколько вам лет?");
int age = Convert.ToInt32(Console.ReadLine());
Console.Write("Какой у вас знак зодиака?");
int totalAmount = 52;
int amountInRow = 3;
int amountOfRows = totalAmount / amountInRow;
int notInRows = totalAmount % amountInRow;
Console.WriteLine($"Получаеться {amountOfRows} рядов, и остается {notInRows} картинок");
string name = "Eremin";
string familyName = "Andrew";
Console.WriteLine($"Ваше имя: {name}, ваша фамилия {familyName}");
string change = name;
name = familyName;
familyName = change;
int money;
int crystal;
int crystalPrice = 10;
Console.WriteLine($"Добро пожаловать в магазин кристалов. Кристалы сегодня по {crystalPrice} золота. Скольео у вас золота?" );
money = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Сколько кристалов вы хотите купить?");
crystal = Convert.ToInt32(Console.ReadLine());
money -= crystal * crystalPrice;
int timePerPerson = 10;
int minutesInHour = 60;
Console.WriteLine("Добро пожаловать в поликлинику! Сколько человек в лчереди?");
int personInLine = Convert.ToInt32(Console.ReadLine());
int timeInLine = timePerPerson * personInLine;
int hoursInLine = timeInLine / minutesInHour;
int minutesInLine = timeInLine % minutesInHour;
string phrase;
int howManyTimes;
Console.WriteLine("Какую фразу вы хотите написать");
phrase = Console.ReadLine();
Console.WriteLine("Сколько раз написать фразу?");
howManyTimes = Convert.ToInt32(Console.ReadLine());
while (howManyTimes > 0)
string password = "exit";
string word;
Console.WriteLine("Введите слово");
word = Console.ReadLine();
bool check = (word == password);
int checkbool = Convert.ToInt32(check);
while (checkbool < 1)
string password = "exit";
string word;
Console.WriteLine("Введите слово");
word = Console.ReadLine();
while (password != word) ;
{
string password = "exit";
string word;
Console.WriteLine("Введите слово");
word = Console.ReadLine();
if (word == password)
{
Console.WriteLine("Верно");
}