Обновить works/c#/lab1/Readme.md

This commit is contained in:
2026-09-24 08:01:20 +00:00
parent 142fa0df8b
commit 9ba7c8e616
+44 -12
View File
@@ -1,17 +1,49 @@
# Задание номер один # отчет
# ЗАДАНИЕ 1. Статический вывод данных
//TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or # Объявление и инициализация переменных
// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter. string pokemonName = "Чармандер";
fun main() { string elementType = "Огонь";
val name = "Kotlin" int level = 1;
//TIP Press <shortcut actionId="ShowIntentionActions"/> with your caret at the highlighted text int hp = 95;
// to see how IntelliJ IDEA suggests fixing it.
println("Hello, " + name + "!")
for (i in 1..5) { * Форматированный вывод в консоль с помощью интерполяции строк
//TIP Press <shortcut actionId="Debug"/> to start debugging your code. We have set one <icon src="AllIcons.Debugger.Db_set_breakpoint"/> breakpoint Console.WriteLine("=== БАЗА ДАННЫХ ПОКЕМОНОВ ===");
// for you, but you can always add more by pressing <shortcut actionId="ToggleLineBreakpoint"/>. Console.WriteLine($"Покемон: {pokemonName}");
println("i = $i") Console.WriteLine($"Стихия: {elementType}");
Console.WriteLine($"Уровень: {level} | HP: {hp}");
// Разделительный отступ между заданиями
Console.WriteLine();
// ==========================================
// ЗАДАНИЕ 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("****************************************");
// Ожидание нажатия клавиши перед закрытием консоли
Console.ReadKey();
}
} }
} }