add lab-01 csharp

This commit is contained in:
EgorGud
2026-09-05 21:49:26 +03:00
parent 9cfe0eed01
commit 25377a61aa
2 changed files with 61 additions and 8 deletions
+36
View File
@@ -0,0 +1,36 @@
## Тема: Введение в язык C#. Переменные, базовые типы данных и консольный ввод/вывод информации
```csharp
//ex 1
string pokemoneName = "Чармандер";
string elementType = "Огонь";
int level = 1;
int hp = 95;
Console.WriteLine($"=== БАЗА ДАННЫХ ПОКЕМОНОВ ===\nПокемон: {pokemoneName}\nСтихия: {elementType}\nУровень: {level} | HP: {hp}");
//ex 2
Console.Write("Введите имя тренера: ");
string trainerName = Console.ReadLine();
Console.Write("Введите имя покемона: ");
string pokemonName = Console.ReadLine();
Console.Write("Введите стихию: ");
string elementType = Console.ReadLine();
Console.Write("Введите регион: ");
string regionName = Console.ReadLine();
Console.WriteLine(); // Пустая строка перед звездочками
Console.WriteLine("****************************************");
Console.WriteLine("ПАСПОРТ ПОКЕМОНА");
Console.WriteLine($"Тренер: {trainerName} (Регион: {regionName})");
Console.WriteLine($"Покемон: {pokemonName} [Стихия: {elementType}]");
Console.WriteLine("****************************************");
```