This commit is contained in:
Puzanova
2026-11-24 10:05:45 +03:00
parent 3c1448c8a7
commit 875c735847
8 changed files with 233 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
{
"sdk": {
"version": "10.0.0",
"rollForward": "latestMinor",
"allowPrerelease": false
}
}
+16
View File
@@ -0,0 +1,16 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "task", "task\task.csproj", "{3070CC6A-0E11-41A9-AE22-0CAD4D1286E8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3070CC6A-0E11-41A9-AE22-0CAD4D1286E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3070CC6A-0E11-41A9-AE22-0CAD4D1286E8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3070CC6A-0E11-41A9-AE22-0CAD4D1286E8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3070CC6A-0E11-41A9-AE22-0CAD4D1286E8}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
+151
View File
@@ -0,0 +1,151 @@
using System;
namespace task
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("задача 1");
string name = "Pikachu" ;
string type = "electric";
int level = 25;
int hp = 120;
double attack = 12.5 ;
bool isShiny = false ;
Console.WriteLine($"{name} ({type}), lvl {level}, HP {hp}, Atk {attack}, shiny: {isShiny}");
hp += 30;
level += 1;
Console.WriteLine($"{name} ({type}), lvl {level}, HP {hp}, Atk {attack}, shiny: {isShiny}");
Console.WriteLine("задача 2");
string attackerType = "fire";
if (attackerType == "fire")
{
Console.WriteLine("Огонь силён против травы");
}
else if (attackerType == "water" )
{
Console.WriteLine("Вода сильна против огня");
}
else if (attackerType =="grass" )
{
Console.WriteLine("Трава сильна против воды");
}
else if (attackerType == "electric" )
{
Console.WriteLine("Электричество сильно против воды");
}
else Console.WriteLine("Тип не изучен");
Console.WriteLine("задача 3");
string type1 = "water";
Console.Write("Урон по water от grass: x");
switch (type1)
{
case "grass":
Console.WriteLine(2.0);
break;
case "electric":
Console.WriteLine(0.5);
break;
case "fire":
Console.WriteLine(0.5);
break;
case "water":
Console.WriteLine(1.0);
break;
default:
Console.WriteLine(1.0);
break;
}
// string type2 = number switch
// {
// "grass" => "2.0",
// "electric" => "2.0",
// "fire" => "0.5",
// "water" => "0.5",
// _ => "1.0"
// };
// Console.WriteLine($"Урон по water от grass: x{type1}");
Console.WriteLine("задача 4");
int hp1 = 100;
int round = 0;
while (hp1 > 0)
{
round++;
hp1 -= 17;
Console.WriteLine($"Покемон продержался {round} раундов, HP = {hp1}");
}
for (int i = 1; i <= 10; i++)
{
Console.WriteLine(i);
}
for (int i = 1; i <= 10; i++)
{
if (i == 3) continue;
if (i == 9) break;
Console.WriteLine(i);
}
Console.WriteLine("задача 5");
List<string> team = new List<string>();
team.Add("Pikachu");
team.Add("Bulbasaur");
team.Add("Charmander");
team.Add("Zubat");
Console.WriteLine(team.Count);
Console.WriteLine(team[1]);
// foreach (string pokemon in team)
// {
// Console.WriteLine($"[Предмет] -> {item}");
// }
Console.WriteLine("задача 6");
var pokedex = new Dictionary<string, int>();
pokedex["Pikachu"] = 0;
pokedex["Bulbasaur"] = 1;
pokedex["Charmander"] = 2;
pokedex["Zubat"] = 3;
// // Проверка наличия
// if (pokedex.ContainsKey("Pikachu"))
// {
// Console.WriteLine(pokedex["Pikachu"]); // 25
// }
//
// // Безопасное получение
// if (pokedex.TryGetValue("Missingno", out int num))
// {
// Console.WriteLine(num);
// }
// else
// {
// Console.WriteLine("Нет в покедексе");
// }
//
// // Перебор
// foreach (var pair in pokedex)
// {
// Console.WriteLine($"{pair.Key} -> {pair.Value}");
// }
//
//
}
}
}
@@ -0,0 +1,23 @@
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": false,
"applicationUrl": "http://localhost:5043",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": false,
"applicationUrl": "https://localhost:7131;http://localhost:5043",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
@@ -0,0 +1,8 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}
+9
View File
@@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}
+13
View File
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="10.0.15"/>
</ItemGroup>
</Project>
+6
View File
@@ -0,0 +1,6 @@
@task_HostAddress = http://localhost:5043
GET {{task_HostAddress}}/weatherforecast/
Accept: application/json
###