Обновить works/csharp/lab-01/Program.cs

This commit is contained in:
2026-09-05 21:31:34 +00:00
parent 11dae25167
commit a57000aa4e
+31 -2
View File
@@ -1,10 +1,39 @@
namespace Lab01 namespace Lab01
{ {
internal class Program internal class Program
{ {
static void Main(string[] args) static void Main(string[] args)
{ {
Console.WriteLine("Лабораторная работа C# №1"); // === ЗАДАНИЕ 1. Объявление переменных и статический вывод данных ===
string pokemonName = "Чармандер";
string elementType = "Огонь";
int level = 1;
int hp = 95;
Console.WriteLine("=== БАЗА ДАННЫХ ПОКЕМОНОВ ===");
Console.WriteLine($"Покемон: {pokemonName}");
Console.WriteLine($"Стихия: {elementType}");
Console.WriteLine($"Уровень: {level} | HP: {hp}\n");
// === ЗАДАНИЕ 2. Интерактивный ввод и динамическое формирование документов ===
Console.Write("Введите имя тренера: ");
string trainerName = Console.ReadLine();
Console.Write("Введите имя покемона: ");
pokemonName = Console.ReadLine();
Console.Write("Введите стихию: ");
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("****************************************");
} }
} }
} }