add 3 lab c#

This commit is contained in:
EgorGud
2026-09-09 11:04:07 +03:00
parent 235b936225
commit 311fdae130
25 changed files with 418 additions and 0 deletions
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,37 @@
{
"Version": 1,
"WorkspaceRootPath": "C:\\prog-radzh\\works\\Csharp\\lab-03\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{90AD7B65-770E-4FB3-BC44-2FC8A293FDDE}|lab-03\\lab-03.csproj|c:\\prog-radzh\\works\\csharp\\lab-03\\lab-03\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{90AD7B65-770E-4FB3-BC44-2FC8A293FDDE}|lab-03\\lab-03.csproj|solutionrelative:lab-03\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
}
],
"DocumentGroupContainers": [
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 0,
"Children": [
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "Program.cs",
"DocumentMoniker": "C:\\prog-radzh\\works\\Csharp\\lab-03\\lab-03\\Program.cs",
"RelativeDocumentMoniker": "lab-03\\Program.cs",
"ToolTip": "C:\\prog-radzh\\works\\Csharp\\lab-03\\lab-03\\Program.cs",
"RelativeToolTip": "lab-03\\Program.cs",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2026-09-08T18:49:46.902Z",
"EditorCaption": ""
}
]
}
]
}
]
}
@@ -0,0 +1,37 @@
{
"Version": 1,
"WorkspaceRootPath": "C:\\prog-radzh\\works\\Csharp\\lab-03\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{90AD7B65-770E-4FB3-BC44-2FC8A293FDDE}|lab-03\\lab-03.csproj|c:\\prog-radzh\\works\\csharp\\lab-03\\lab-03\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{90AD7B65-770E-4FB3-BC44-2FC8A293FDDE}|lab-03\\lab-03.csproj|solutionrelative:lab-03\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
}
],
"DocumentGroupContainers": [
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 0,
"Children": [
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "Program.cs",
"DocumentMoniker": "C:\\prog-radzh\\works\\Csharp\\lab-03\\lab-03\\Program.cs",
"RelativeDocumentMoniker": "lab-03\\Program.cs",
"ToolTip": "C:\\prog-radzh\\works\\Csharp\\lab-03\\lab-03\\Program.cs",
"RelativeToolTip": "lab-03\\Program.cs",
"ViewState": "AgIAAAAAAAAAAAAAAAAAACEAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2026-09-08T18:49:46.902Z",
"EditorCaption": ""
}
]
}
]
}
]
}
View File
+25
View File
@@ -0,0 +1,25 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.14.37614.0 d17.14
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "lab-03", "lab-03\lab-03.csproj", "{90AD7B65-770E-4FB3-BC44-2FC8A293FDDE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{90AD7B65-770E-4FB3-BC44-2FC8A293FDDE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{90AD7B65-770E-4FB3-BC44-2FC8A293FDDE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{90AD7B65-770E-4FB3-BC44-2FC8A293FDDE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{90AD7B65-770E-4FB3-BC44-2FC8A293FDDE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {4E2974E8-28C9-47E5-99A5-F84249F3DF3C}
EndGlobalSection
EndGlobal
+44
View File
@@ -0,0 +1,44 @@
// task 1
/*
string pokemon1Name = "Пикачу";
int pokemon1Hp = 50;
int pokemon1Attack = 12;
string pokemon2Name = "Булбазавр";
int pokemon2Hp = 55;
int pokemon2Attack = 10;
int roundNumber = 1;
Console.WriteLine("Приготовьтесь!");
for (int i = 3 ; i >= roundNumber ; i--)
{
Console.WriteLine(i + "...");
Thread.Sleep(1000);
}
Console.WriteLine("=== БОЙ НАЧИНАЕТСЯ ===");
Console.WriteLine($"{pokemon1Name} (HP: {pokemon1Hp} | Атака: {pokemon1Attack}) VS {pokemon2Name} (HP: {pokemon2Hp} | Атака: {pokemon2Attack})");
*/
// task 2
using System.ComponentModel.Design;
int choice;
Console.Write("Готовы начать бой? (1 - Да, 0 - Нет): ");
do
{
choice = int.Parse(Console.ReadLine());
if (choice == 1)
{
Console.WriteLine("Вы начали бой!");
}
else if (choice == 0)
{
Console.WriteLine("Вы отменили бой!");
}
else
{
Console.WriteLine("Некорректная команда! Попробуйте снова.");
}
} while (choice != 1 && choice != 0);
+11
View File
@@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace>lab_03</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>
@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")]
@@ -0,0 +1,22 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("lab-03")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+494da37720a35a8e6f1afbe4a8830aa4493c43b7")]
[assembly: System.Reflection.AssemblyProductAttribute("lab-03")]
[assembly: System.Reflection.AssemblyTitleAttribute("lab-03")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// Generated by the MSBuild WriteCodeFragment class.
@@ -0,0 +1 @@
deb11dc12e69503452c0048f81f5a7a5538b6575cb69d80def424034c77d25a7
@@ -0,0 +1,18 @@
is_global = true
build_property.TargetFramework = net9.0
build_property.TargetFrameworkIdentifier = .NETCoreApp
build_property.TargetFrameworkVersion = v9.0
build_property.TargetPlatformMinVersion =
build_property.UsingMicrosoftNETSdkWeb =
build_property.ProjectTypeGuids =
build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property.EntryPointFilePath =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = lab_03
build_property.ProjectDir = Z:\prog-radzh\works\Csharp\lab-03\lab-03\
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =
build_property.EffectiveAnalysisLevelStyle = 9.0
build_property.EnableCodeStyleSeverity =
@@ -0,0 +1,8 @@
// <auto-generated/>
global using System;
global using System.Collections.Generic;
global using System.IO;
global using System.Linq;
global using System.Net.Http;
global using System.Threading;
global using System.Threading.Tasks;
@@ -0,0 +1,87 @@
{
"format": 1,
"restore": {
"Z:\\prog-radzh\\works\\Csharp\\lab-03\\lab-03\\lab-03.csproj": {}
},
"projects": {
"Z:\\prog-radzh\\works\\Csharp\\lab-03\\lab-03\\lab-03.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "Z:\\prog-radzh\\works\\Csharp\\lab-03\\lab-03\\lab-03.csproj",
"projectName": "lab-03",
"projectPath": "Z:\\prog-radzh\\works\\Csharp\\lab-03\\lab-03\\lab-03.csproj",
"packagesPath": "C:\\Users\\228p\\.nuget\\packages\\",
"outputPath": "Z:\\prog-radzh\\works\\Csharp\\lab-03\\lab-03\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\228p\\AppData\\Roaming\\NuGet\\NuGet.Config"
],
"originalTargetFrameworks": [
"net9.0"
],
"sources": {
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net9.0": {
"framework": "net9.0",
"targetAlias": "net9.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "direct"
},
"SdkAnalysisLevel": "10.0.400"
},
"frameworks": {
"net9.0": {
"framework": "net9.0",
"targetAlias": "net9.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"downloadDependencies": [
{
"name": "Microsoft.AspNetCore.App.Ref",
"version": "[9.0.19, 9.0.19]"
},
{
"name": "Microsoft.NETCore.App.Host.win-x64",
"version": "[9.0.19, 9.0.19]"
},
{
"name": "Microsoft.NETCore.App.Ref",
"version": "[9.0.19, 9.0.19]"
},
{
"name": "Microsoft.WindowsDesktop.App.Ref",
"version": "[9.0.19, 9.0.19]"
}
],
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\10.0.400/PortableRuntimeIdentifierGraph.json"
}
}
}
}
}
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\228p\.nuget\packages\</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">7.0.0</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\228p\.nuget\packages\" />
</ItemGroup>
</Project>
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
@@ -0,0 +1,92 @@
{
"version": 4,
"targets": {
"net9.0": {}
},
"libraries": {},
"projectFileDependencyGroups": {
"net9.0": []
},
"packageFolders": {
"C:\\Users\\228p\\.nuget\\packages\\": {}
},
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "Z:\\prog-radzh\\works\\Csharp\\lab-03\\lab-03\\lab-03.csproj",
"projectName": "lab-03",
"projectPath": "Z:\\prog-radzh\\works\\Csharp\\lab-03\\lab-03\\lab-03.csproj",
"packagesPath": "C:\\Users\\228p\\.nuget\\packages\\",
"outputPath": "Z:\\prog-radzh\\works\\Csharp\\lab-03\\lab-03\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\228p\\AppData\\Roaming\\NuGet\\NuGet.Config"
],
"originalTargetFrameworks": [
"net9.0"
],
"sources": {
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net9.0": {
"framework": "net9.0",
"targetAlias": "net9.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "direct"
},
"SdkAnalysisLevel": "10.0.400"
},
"frameworks": {
"net9.0": {
"framework": "net9.0",
"targetAlias": "net9.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"downloadDependencies": [
{
"name": "Microsoft.AspNetCore.App.Ref",
"version": "[9.0.19, 9.0.19]"
},
{
"name": "Microsoft.NETCore.App.Host.win-x64",
"version": "[9.0.19, 9.0.19]"
},
{
"name": "Microsoft.NETCore.App.Ref",
"version": "[9.0.19, 9.0.19]"
},
{
"name": "Microsoft.WindowsDesktop.App.Ref",
"version": "[9.0.19, 9.0.19]"
}
],
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\10.0.400/PortableRuntimeIdentifierGraph.json"
}
}
}
}
@@ -0,0 +1,13 @@
{
"version": 2,
"dgSpecHash": "AbblvEY9Z5o=",
"success": true,
"projectFilePath": "Z:\\prog-radzh\\works\\Csharp\\lab-03\\lab-03\\lab-03.csproj",
"expectedPackageFiles": [
"C:\\Users\\228p\\.nuget\\packages\\microsoft.netcore.app.ref\\9.0.19\\microsoft.netcore.app.ref.9.0.19.nupkg.sha512",
"C:\\Users\\228p\\.nuget\\packages\\microsoft.windowsdesktop.app.ref\\9.0.19\\microsoft.windowsdesktop.app.ref.9.0.19.nupkg.sha512",
"C:\\Users\\228p\\.nuget\\packages\\microsoft.aspnetcore.app.ref\\9.0.19\\microsoft.aspnetcore.app.ref.9.0.19.nupkg.sha512",
"C:\\Users\\228p\\.nuget\\packages\\microsoft.netcore.app.host.win-x64\\9.0.19\\microsoft.netcore.app.host.win-x64.9.0.19.nupkg.sha512"
],
"logs": []
}
@@ -0,0 +1 @@
"restore":{"projectUniqueName":"Z:\\prog-radzh\\works\\Csharp\\lab-03\\lab-03\\lab-03.csproj","projectName":"lab-03","projectPath":"Z:\\prog-radzh\\works\\Csharp\\lab-03\\lab-03\\lab-03.csproj","packagesPath":"","outputPath":"Z:\\prog-radzh\\works\\Csharp\\lab-03\\lab-03\\obj\\","projectStyle":"PackageReference","originalTargetFrameworks":["net9.0"],"sources":{"https://api.nuget.org/v3/index.json":{}},"frameworks":{"net9.0":{"framework":"net9.0","targetAlias":"net9.0","projectReferences":{}}},"warningProperties":{"warnAsError":["NU1605"]},"restoreAuditProperties":{"enableAudit":"true","auditLevel":"low","auditMode":"direct"},"SdkAnalysisLevel":"10.0.400"}"frameworks":{"net9.0":{"framework":"net9.0","targetAlias":"net9.0","imports":["net461","net462","net47","net471","net472","net48","net481"],"assetTargetFallback":true,"warn":true,"downloadDependencies":[{"name":"Microsoft.AspNetCore.App.Ref","version":"[9.0.19, 9.0.19]"},{"name":"Microsoft.NETCore.App.Host.win-x64","version":"[9.0.19, 9.0.19]"},{"name":"Microsoft.NETCore.App.Ref","version":"[9.0.19, 9.0.19]"},{"name":"Microsoft.WindowsDesktop.App.Ref","version":"[9.0.19, 9.0.19]"}],"frameworkReferences":{"Microsoft.NETCore.App":{"privateAssets":"all"}},"runtimeIdentifierGraphPath":"C:\\Program Files\\dotnet\\sdk\\10.0.400/PortableRuntimeIdentifierGraph.json"}}
@@ -0,0 +1 @@
17889352130712831