Добавьте файлы проекта.
This commit is contained in:
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 16
|
||||
VisualStudioVersion = 16.0.31005.135
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp1", "ConsoleApp1\ConsoleApp1.csproj", "{50B110DE-6CE7-45B2-B7DA-069095FA1F53}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{50B110DE-6CE7-45B2-B7DA-069095FA1F53}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{50B110DE-6CE7-45B2-B7DA-069095FA1F53}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{50B110DE-6CE7-45B2-B7DA-069095FA1F53}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{50B110DE-6CE7-45B2-B7DA-069095FA1F53}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {4E7C6161-B560-4A8A-8189-174879645082}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
8
ConsoleApp1/ConsoleApp1.csproj
Normal file
8
ConsoleApp1/ConsoleApp1.csproj
Normal file
@ -0,0 +1,8 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
42
ConsoleApp1/Program.cs
Normal file
42
ConsoleApp1/Program.cs
Normal file
@ -0,0 +1,42 @@
|
||||
using System;
|
||||
|
||||
namespace ConsoleApp1
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
int num1 = 0;
|
||||
int num2 = 0;
|
||||
Console.WriteLine("Приветствую в калькуляторе!");
|
||||
Console.WriteLine("Введите первое число");
|
||||
num1 = Convert.ToInt32(Console.ReadLine());
|
||||
|
||||
Console.WriteLine("Введите второе число");
|
||||
num2 = Convert.ToInt32(Console.ReadLine());
|
||||
|
||||
Console.WriteLine("\ta - Сложение");
|
||||
Console.WriteLine("\tb - Вычитание");
|
||||
Console.WriteLine("\tc - Умножение");
|
||||
Console.WriteLine("\td - Деление");
|
||||
|
||||
switch (Console.ReadLine())
|
||||
{
|
||||
case "a":
|
||||
Console.WriteLine($"Ваш результат: {num1} + {num2} = " + (num1 + num2));
|
||||
break;
|
||||
case "b":
|
||||
Console.WriteLine($"Ваш результат: {num1} - {num2} = " + (num1 - num2));
|
||||
break;
|
||||
case "c":
|
||||
Console.WriteLine($"Ваш результат: {num1} * {num2} = " + (num1 * num2));
|
||||
break;
|
||||
case "d":
|
||||
Console.WriteLine($"Ваш результат: {num1} / {num2} = " + (num1 / num2));
|
||||
break;
|
||||
}
|
||||
Console.WriteLine("Нажмите любую клавишу");
|
||||
Console.ReadKey();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user