Добавьте файлы проекта.
This commit is contained in:
parent
ad368f8ff8
commit
96f8e9774a
25
ConsoleApp1.sln
Normal file
25
ConsoleApp1.sln
Normal file
@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.8.34511.84
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp1", "ConsoleApp1\ConsoleApp1.csproj", "{6214036E-C64E-4150-8728-8681AA2E07AF}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{6214036E-C64E-4150-8728-8681AA2E07AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{6214036E-C64E-4150-8728-8681AA2E07AF}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{6214036E-C64E-4150-8728-8681AA2E07AF}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{6214036E-C64E-4150-8728-8681AA2E07AF}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {792CA066-4535-4CD5-9608-1EE77D2C6DEB}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
10
ConsoleApp1/ConsoleApp1.csproj
Normal file
10
ConsoleApp1/ConsoleApp1.csproj
Normal file
@ -0,0 +1,10 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
34
ConsoleApp1/Program.cs
Normal file
34
ConsoleApp1/Program.cs
Normal file
@ -0,0 +1,34 @@
|
||||
namespace ConsoleApp1
|
||||
{
|
||||
internal class Program
|
||||
{
|
||||
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Random random = new Random();
|
||||
int value = random.Next(1, 10);
|
||||
int user = Convert.ToInt32(Console.ReadLine());
|
||||
int count = 1;
|
||||
while (user != value) {
|
||||
count++;
|
||||
if (count == 6) {
|
||||
Console.WriteLine("Вы не угадали. У вас закончились попытки");
|
||||
break;
|
||||
}
|
||||
if (user > value)
|
||||
{
|
||||
Console.WriteLine("Число меньше");
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Число больше");
|
||||
}
|
||||
user = Convert.ToInt32(Console.ReadLine());
|
||||
}
|
||||
if (count < 6)
|
||||
{
|
||||
Console.WriteLine("Вы угадали за " + count.ToString() + " попыток");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user