Skip to content

Instantly share code, notes, and snippets.

@rgweh
rgweh / gist:84a4fc9e85ef13f177bf6abb6925e67d
Last active August 13, 2024 12:24
ДЗ: Переменные
int age = 20;
int coins = 3;
int dollars = 3;
byte steps = 3;
sbyte balance = -1;
@rgweh
rgweh / gist:69258e1d342f6171ba0732ace15c5966
Last active August 13, 2024 12:54
ДЗ: Работа со строками
string name;
string surname;
int age;
string city;
Console.WriteLine("Как вас зовут?");
name = Console.ReadLine();
Console.WriteLine("\nКакая у вас фамилия?");
surname = Console.ReadLine();
@rgweh
rgweh / gist:d8c0ec5140dd36e75e3583a168a76161
Created August 13, 2024 12:50
ДЗ: Картинки
int imagesTotal = 52;
int imagesInRow = 3;
int albumRows = imagesTotal / imagesInRow;
int excessImages = imagesTotal % imagesInRow;
Console.WriteLine(albumRows + " полных строк в альбоме\n");
Console.WriteLine(excessImages + " картинок в неполной строке");
Console.ReadKey();
@rgweh
rgweh / gist:fecaccf6bbcc89e9ccaee4c0a0eebd0d
Created August 13, 2024 13:01
ДЗ: Перестановка местами значений
string guest1 = "Коля";
string guest2 = "Петя";
string holder;
Console.WriteLine($"Гость 1 - {guest1}, Гость 2 - {guest2}");
holder = guest1;
guest1 = guest2;
guest2 = holder;
@rgweh
rgweh / gist:4b98c991dd0231a71bcc871b2f948565
Last active August 13, 2024 14:01
ДЗ: Магазин кристаллов
using System;
namespace Переменные_ДЗ1
{
internal class Program
{
static void Main(string[] args)
{
int gold;
int order;
@rgweh
rgweh / gist:58b8a537422ff15bbb7a2240cb519c97
Last active August 13, 2024 14:57
ДЗ: Поликлиника
using System;
namespace Переменные_ДЗ1
{
internal class Program
{
static void Main(string[] args)
{
int patientsCount;
int minutesInHour = 60;
@rgweh
rgweh / gist:1d0f0955c55c98ce8e9a0a0c817393a9
Last active August 14, 2024 05:12
ДЗ: Освоение циклов
using System;
namespace HomeWorks
{
internal class Program
{
static void Main(string[] args)
{
Console.WriteLine("Какую фразу мне написать?");
string phraze = Console.ReadLine();
@rgweh
rgweh / gist:f3e677ba6fa12a13f395529ee6d6453a
Last active August 14, 2024 05:15
ДЗ: Контроль выхода
using System;
namespace HomeWorks
{
internal class Program
{
static void Main(string[] args)
{
const string CommandExit = "exit";
string input = null;
@rgweh
rgweh / gist:889354d309b451f5081c379ffbaca377
Last active August 14, 2024 07:43
ДЗ: Последовательность
using System;
using System;
namespace HomeWorks
{
internal class Program
{
static void Main(string[] args)
{
@rgweh
rgweh / gist:a79317c1890e2c74b0848c9a1154c939
Last active August 14, 2024 05:20
ДЗ: Сумма чисел
using System;
namespace HomeWorks
{
internal class Program
{
static void Main(string[] args)
{
Random randomizer = new Random();