Skip to content

Commit

Permalink
Added C# projects
Browse files Browse the repository at this point in the history
  • Loading branch information
Stanislaw-Rudnicki committed Jul 21, 2020
1 parent 902d5ac commit 7705197
Show file tree
Hide file tree
Showing 166 changed files with 7,718 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CS01_1_T01/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>
53 changes: 53 additions & 0 deletions CS01_1_T01/CS01_1_T01.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{C2CD3F35-CBDF-4981-818C-0ECFDB43CB09}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>CS01_1_T01</RootNamespace>
<AssemblyName>CS01_1_T01</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
25 changes: 25 additions & 0 deletions CS01_1_T01/CS01_1_T01.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29806.167
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CS01_1_T01", "CS01_1_T01.csproj", "{C2CD3F35-CBDF-4981-818C-0ECFDB43CB09}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C2CD3F35-CBDF-4981-818C-0ECFDB43CB09}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C2CD3F35-CBDF-4981-818C-0ECFDB43CB09}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C2CD3F35-CBDF-4981-818C-0ECFDB43CB09}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C2CD3F35-CBDF-4981-818C-0ECFDB43CB09}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {AF1C22F2-0E7B-424F-80AE-AB5AAF4D976D}
EndGlobalSection
EndGlobal
162 changes: 162 additions & 0 deletions CS01_1_T01/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
using System;
using System.Globalization;
using System.Text;
using System.Threading;

namespace _29022020
{
class Program
{
// Написать программу, которая считывает символы с клавиатуры, пока не будет введена точка.
// Программа должна сосчитать количество введенных пользователем пробелов.

static void Zad_01()
{
char ch;
int i = 0;
do
{
Console.Write("Введите символ: ");
ch = Console.ReadLine()[0];
if (ch == ' ') i++;
} while (ch != '.');
Console.WriteLine($"Пробелов: {i}\n");
}

// Ввести с клавиатуры номер трамвайного билета (6-значное число)
// и про-верить является ли данный билет счастливым
// (если на билете напечатано шестизначное число,
// и сумма первых трёх цифр равна сумме последних трёх, то этот билет считается счастливым).

static void Zad_02()
{
bool lucky(int a)
{
int sum1, sum2;
sum1 = a / 100000 + (a / 10000 % 10) + (a / 1000 % 10);
sum2 = a / 100 % 10 + (a / 10 % 10) + a % 10;
return (sum1 == sum2);
}

Console.Write("Введіть шестизначне число: ");
bool f = int.TryParse(Console.ReadLine(), out int n);

if (f && n > 99999 && n < 1000000)
{
Console.Write("\n\tЧисло ");
if (!lucky(n)) Console.Write("не ");
Console.WriteLine("щасливе!\n");
}
else
Console.WriteLine("\n\tЧисло не шестизначне!\n");

}

// Числовые значения символов нижнего регистра в коде ASCII отличаются от значений символов верхнего регистра на величину 32.
// Используя эту информацию, написать программу, которая считывает с клавиатуры и конвертирует
// все символы нижнего регистра в символы верхнего регистра и наоборот.

static void Zad_03()
{
Console.Write("Введите строку: ");
string str = Console.ReadLine();

// Тут +-32 не буде робити для кирилиці, тому що використовується UTF-16.
// Щоб робила кирилиця з UTF-16, треба якось так писати:

string OppositeCase(string s)
{
char[] c = s.ToCharArray();
char[] cUpper = s.ToUpper().ToCharArray();
char[] cLower = s.ToLower().ToCharArray();

for (int i = 0; i < c.Length; i++)
if (c[i] == cUpper[i])
c[i] = cLower[i];
else
c[i] = cUpper[i];

return new string(c);
}
Console.WriteLine("\n" + OppositeCase(str) + "\n");
}

// Даны целые положительные числа A и B (A < B).
// Вывести все целые числа от A до B включительно; каждое число должно выводиться на новой строке;
// при этом каждое число должно выводиться количество раз, равное его значению.
// Например: если А = 3, а В = 7, то программа должна сформировать в консоли следующий вывод:
// 3 3 3
// 4 4 4 4
// 5 5 5 5 5
// 6 6 6 6 6 6
// 7 7 7 7 7 7 7

static void Zad_04()
{
int a = 0, b = 0;
bool f = false;
while (!f)
{
Console.Write("Введіть A: ");
f = int.TryParse(Console.ReadLine(), out a);
}
f = false;
while (!f)
{
Console.Write("Введіть B: ");
f = int.TryParse(Console.ReadLine(), out b);
}

if (a < b)
{
Console.WriteLine();
for (int i = a; i <= b; i++)
{
for (int j = 0; j < i; j++)
Console.Write(i + " ");
Console.WriteLine();
}
Console.WriteLine();
}
else
Console.WriteLine("\nError: A > B\n");

}

// Дано целое число N (> 0), найти число, полученное при прочтении числа N справа налево.
// Например, если было введено число 345, то программа должна вывести число 543.

static void Zad_05()
{
int n = 0, m = 0;
bool f = false;
while (!f)
{
Console.Write("Введіть N: ");
f = int.TryParse(Console.ReadLine(), out n);
}

while (n > 0)
{
int rest = n % 10;
n /= 10;
m = m * 10 + rest;
}
Console.WriteLine($"\n{m}\n");
}

static void Main(string[] args)
{
Console.OutputEncoding = Encoding.Unicode;
Console.InputEncoding = Encoding.Unicode;

Zad_01();
Zad_02();
Zad_03();
Zad_04();
Zad_05();

//Console.ReadKey();
}
}
}
36 changes: 36 additions & 0 deletions CS01_1_T01/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("CS01_1_T01")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CS01_1_T01")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("c2cd3f35-cbdf-4981-818c-0ecfdb43cb09")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
6 changes: 6 additions & 0 deletions Cs01_1_t02/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>
53 changes: 53 additions & 0 deletions Cs01_1_t02/Cs01_1_t02.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{23EFC825-1AD1-490F-A44A-A4D6BCE57C76}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>Cs01_1_t02</RootNamespace>
<AssemblyName>Cs01_1_t02</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
25 changes: 25 additions & 0 deletions Cs01_1_t02/Cs01_1_t02.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29806.167
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cs01_1_t02", "Cs01_1_t02.csproj", "{23EFC825-1AD1-490F-A44A-A4D6BCE57C76}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{23EFC825-1AD1-490F-A44A-A4D6BCE57C76}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{23EFC825-1AD1-490F-A44A-A4D6BCE57C76}.Debug|Any CPU.Build.0 = Debug|Any CPU
{23EFC825-1AD1-490F-A44A-A4D6BCE57C76}.Release|Any CPU.ActiveCfg = Release|Any CPU
{23EFC825-1AD1-490F-A44A-A4D6BCE57C76}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {167A641E-62C1-49E1-8E66-4B3DB797266D}
EndGlobalSection
EndGlobal
Loading

0 comments on commit 7705197

Please sign in to comment.