generated from admin/template
Compare commits
5
Commits
14c15523e1
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
11c4826278 | ||
|
|
35caf87663 | ||
|
|
473a8e7cf8 | ||
|
|
04fb0bad0c | ||
|
|
87d3650762 |
+64
-1
@@ -1,7 +1,7 @@
|
||||
# Лабораторная работа №1
|
||||
|
||||
* **Студент:** Лю-Фа Александр
|
||||
* **Вариант / Карточка:** Задание 1 и 2
|
||||
* **Вариант / Карточка:** Задание lesson1 и stage1
|
||||
|
||||
---
|
||||
|
||||
@@ -43,5 +43,68 @@ class Program {
|
||||
Console.WriteLine($"Тренер: {trainerName} (Регион: {regionName})");
|
||||
Console.WriteLine($"Покемон: {pokemonName} [Стихия: {elementType}]");
|
||||
Console.WriteLine("****************************************");
|
||||
}
|
||||
}
|
||||
|
||||
using System;
|
||||
|
||||
class Program {
|
||||
static void Main() {
|
||||
Console.Write("Введите стадию развития: \n");
|
||||
string stage = Console.ReadLine();
|
||||
|
||||
Console.Write("Введите имя покемона: \n");
|
||||
string name = Console.ReadLine();
|
||||
|
||||
Console.Write("Введите вид покемона: \n");
|
||||
string category = Console.ReadLine();
|
||||
|
||||
Console.Write("Введите название первой атаки: \n");
|
||||
string attack1Name = Console.ReadLine();
|
||||
|
||||
Console.Write("Введите эффект первой атаки: \n");
|
||||
string attack1Desc = Console.ReadLine();
|
||||
|
||||
Console.Write("Введите название второй атаки: \n");
|
||||
string attack2Name = Console.ReadLine();
|
||||
|
||||
Console.Write("Введите эффект второй атаки: \n");
|
||||
string attack2Desc = Console.ReadLine();
|
||||
|
||||
Console.Write("Введите уязвимость: \n");
|
||||
string weakness = Console.ReadLine();
|
||||
|
||||
Console.Write("Введите устойчивость: \n\n\n");
|
||||
string resistance = Console.ReadLine();
|
||||
|
||||
int hp = 60;
|
||||
int number = 25;
|
||||
double height = 0.4;
|
||||
double weight = 6.0;
|
||||
int attack2Damage = 20;
|
||||
int retreatCost = 1;
|
||||
|
||||
Console.Clear();
|
||||
|
||||
Console.WriteLine("======================================================================");
|
||||
Console.WriteLine($"[{stage}] {name, -42} ОЖ: {hp} [⚡]");
|
||||
Console.WriteLine("----------------------------------------------------------------------");
|
||||
Console.WriteLine($"№ 0{number} | Вид: {category} | Рост: {height} м | Вес: {weight} кг");
|
||||
Console.WriteLine("----------------------------------------------------------------------");
|
||||
Console.WriteLine($"[Атака 1] {attack1Name}");
|
||||
Console.WriteLine($"Эффект: {attack1Desc}");
|
||||
Console.WriteLine();
|
||||
Console.WriteLine($"[Атака 2] {attack2Name, -35} Урон: {attack2Damage}+");
|
||||
Console.WriteLine($"Эффект: {attack2Desc}");
|
||||
Console.WriteLine("----------------------------------------------------------------------");
|
||||
Console.WriteLine($"Слабость: {weakness}");
|
||||
Console.WriteLine($"Устойчивость: {resistance}");
|
||||
Console.WriteLine($"Отступление: {retreatCost}");
|
||||
Console.WriteLine("======================================================================");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp1", "ConsoleApp1\ConsoleApp1.csproj", "{8C3B83ED-8C9F-4D82-9174-F2C6F8EA886B}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{8C3B83ED-8C9F-4D82-9174-F2C6F8EA886B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{8C3B83ED-8C9F-4D82-9174-F2C6F8EA886B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{8C3B83ED-8C9F-4D82-9174-F2C6F8EA886B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{8C3B83ED-8C9F-4D82-9174-F2C6F8EA886B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,10 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,43 @@
|
||||
namespace ConsoleApp1;
|
||||
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
//Console.WriteLine("=== Прокачка покемона ===");
|
||||
|
||||
//Console.Write("Введите базовую атаку покемона: ");
|
||||
//int baseAttack = int.Parse(Console.ReadLine());
|
||||
|
||||
//Console.Write("Введите количество полученных уровней: ");
|
||||
//int level = int.Parse(Console.ReadLine());
|
||||
|
||||
//int finalAttack = baseAttack +(level*5);
|
||||
|
||||
//Console.WriteLine($"Итоговое значение атаки: {finalAttack}");
|
||||
|
||||
int balance = 1500;
|
||||
int potionPrice = 200;
|
||||
|
||||
Console.WriteLine($"Текущий баланс: {balance} монет");
|
||||
|
||||
Console.Write("Введите количество зелий: ");
|
||||
int potions = int.Parse(Console.ReadLine());
|
||||
|
||||
int totalCost = potions * potionPrice;
|
||||
|
||||
if (totalCost <= balance)
|
||||
{
|
||||
int remainingBalance = balance - totalCost;
|
||||
Console.WriteLine("Покупка успешно совершена!");
|
||||
Console.WriteLine($"Стоимость покупки: {totalCost} монет");
|
||||
Console.WriteLine($"Остаток на балансе: {remainingBalance} монет");
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Недостаточно средств");
|
||||
Console.WriteLine($"Необходимо: {totalCost} монет");
|
||||
Console.WriteLine($"Ваш баланс: {balance} монет");
|
||||
}
|
||||
}
|
||||
}
|
||||
+44
-6
@@ -1,15 +1,53 @@
|
||||
# Лабораторная работа №2
|
||||
|
||||
* **Студент:** [ФИО]
|
||||
* **Вариант / Карточка:** [Например: #025 Pikachu]
|
||||
* **Студент:** Лю-Фа Александр Евгеньевич
|
||||
* **Вариант / Карточка:** Лабораторная 2
|
||||
|
||||
---
|
||||
|
||||
## Ключевой код
|
||||
```csharp
|
||||
// Самая важная часть реализации (методы, структуры, логика)
|
||||
public class Card
|
||||
namespace ConsoleApp1;
|
||||
|
||||
class Program
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public int Hp { get; set; }
|
||||
}
|
||||
static void Main(string[] args)
|
||||
{
|
||||
//Console.WriteLine("=== Прокачка покемона ===");
|
||||
|
||||
//Console.Write("Введите базовую атаку покемона: ");
|
||||
//int baseAttack = int.Parse(Console.ReadLine());
|
||||
|
||||
//Console.Write("Введите количество полученных уровней: ");
|
||||
//int level = int.Parse(Console.ReadLine());
|
||||
|
||||
//int finalAttack = baseAttack +(level*5);
|
||||
|
||||
//Console.WriteLine($"Итоговое значение атаки: {finalAttack}");
|
||||
|
||||
int balance = 1500;
|
||||
int potionPrice = 200;
|
||||
|
||||
Console.WriteLine($"Текущий баланс: {balance} монет");
|
||||
|
||||
Console.Write("Введите количество зелий: ");
|
||||
int potions = int.Parse(Console.ReadLine());
|
||||
|
||||
int totalCost = potions * potionPrice;
|
||||
|
||||
if (totalCost <= balance)
|
||||
{
|
||||
int remainingBalance = balance - totalCost;
|
||||
Console.WriteLine("Покупка успешно совершена!");
|
||||
Console.WriteLine($"Стоимость покупки: {totalCost} монет");
|
||||
Console.WriteLine($"Остаток на балансе: {remainingBalance} монет");
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Недостаточно средств");
|
||||
Console.WriteLine($"Необходимо: {totalCost} монет");
|
||||
Console.WriteLine($"Ваш баланс: {balance} монет");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user