Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion FifthLesson/readme.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Fifth lesson of Margelov Vitaly
Fifth lesson of Nikolaev Pavel
6 changes: 6 additions & 0 deletions FirstLesson/ConsoleApp16/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.5.2" />
</startup>
</configuration>
52 changes: 52 additions & 0 deletions FirstLesson/ConsoleApp16/ConsoleApp16.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?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>{F157977E-646F-498B-9528-10FA575EA9E6}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>ConsoleApp16</RootNamespace>
<AssemblyName>ConsoleApp16</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</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>
28 changes: 28 additions & 0 deletions FirstLesson/ConsoleApp16/ConsoleApp16.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26430.12
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp16", "ConsoleApp16\ConsoleApp16.csproj", "{F157977E-646F-498B-9528-10FA575EA9E6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTestProject1", "UnitTestProject1\UnitTestProject1.csproj", "{54CB555F-AD29-4FA1-9404-79022B6B43C2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F157977E-646F-498B-9528-10FA575EA9E6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F157977E-646F-498B-9528-10FA575EA9E6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F157977E-646F-498B-9528-10FA575EA9E6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F157977E-646F-498B-9528-10FA575EA9E6}.Release|Any CPU.Build.0 = Release|Any CPU
{54CB555F-AD29-4FA1-9404-79022B6B43C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{54CB555F-AD29-4FA1-9404-79022B6B43C2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{54CB555F-AD29-4FA1-9404-79022B6B43C2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{54CB555F-AD29-4FA1-9404-79022B6B43C2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
6 changes: 6 additions & 0 deletions FirstLesson/ConsoleApp16/ConsoleApp16/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.5.2" />
</startup>
</configuration>
52 changes: 52 additions & 0 deletions FirstLesson/ConsoleApp16/ConsoleApp16/ConsoleApp16.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?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>{F157977E-646F-498B-9528-10FA575EA9E6}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>ConsoleApp16</RootNamespace>
<AssemblyName>ConsoleApp16</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</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>
97 changes: 97 additions & 0 deletions FirstLesson/ConsoleApp16/ConsoleApp16/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;

namespace ConsoleApp16
{
public class Program
{

public static string[] readingFile()
{
string path = @"C:\Users\User\Desktop\test.csv";
string[] lines = File.ReadAllLines(path);
return lines;
}

public static int countAll(string[] lines)
{
int count = 0;
count = lines.Length - 1;
return count;
}

public static int countOfDormitory(string[] lines)
{
int count = 0;

for (int i = 1; i < lines.Length; i++)
{
for (int j = 0; j < 6; j++)
{
lines[i] = lines[i].Substring(0, lines[i].LastIndexOf(';'));
}

if (lines[i][lines[i].Length-1] == 'а')
{
count++;
}
}
return count;
}

public static int[] countOfCourses(string[] lines)
{
int[] course = new int[3];

for (int i = 1; i < lines.Length; i++)
{
for (int j = 0; j < 2; j++)
{
lines[i] = lines[i].Substring(lines[i].IndexOf(';') + 1);
}

switch (lines[i][0])
{
case '1':
course[0]++;
break;
case '2':
course[1]++;
break;
case '3':
course[2]++;
break;
default:
break;
}
}
return course;
}

static void Main(string[] args)
{
string[] linesFile = readingFile();
int[] courses = countOfCourses(linesFile);

Console.Write("Всего анкет: ");
Console.WriteLine(countAll(linesFile));
Console.Write("Анкет первого курса: ");
Console.WriteLine(courses[0]);
Console.Write("Анкет второго курса: ");
Console.WriteLine(courses[1]);
Console.Write("Анкет третьего курса: ");
Console.WriteLine(courses[2]);
Console.Write("Людей, проживающих в общажитии: ");
Console.WriteLine(countOfDormitory(linesFile));
}
}
}
//чтение файла
//парсинг
//кол-во анкет
//разделение по курсам
//Кол-во общажников
36 changes: 36 additions & 0 deletions FirstLesson/ConsoleApp16/ConsoleApp16/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;

// Общие сведения об этой сборке предоставляются следующим набором
// набора атрибутов. Измените значения этих атрибутов, чтобы изменить сведения,
// связанные со сборкой.
[assembly: AssemblyTitle("ConsoleApp16")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ConsoleApp16")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми
// для компонентов COM. Если необходимо обратиться к типу в этой сборке через
// COM, задайте атрибуту ComVisible значение TRUE для этого типа.
[assembly: ComVisible(false)]

// Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM
[assembly: Guid("f157977e-646f-498b-9528-10fa575ea9e6")]

// Сведения о версии сборки состоят из следующих четырех значений:
//
// Основной номер версии
// Дополнительный номер версии
// Номер сборки
// Редакция
//
// Можно задать все значения или принять номер сборки и номер редакции по умолчанию.
// используя "*", как показано ниже:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Binary file not shown.
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.5.2" />
</startup>
</configuration>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
C:\Users\User\Documents\Visual Studio 2017\Projects\ConsoleApp16\ConsoleApp16\bin\Debug\ConsoleApp16.exe.config
C:\Users\User\Documents\Visual Studio 2017\Projects\ConsoleApp16\ConsoleApp16\bin\Debug\ConsoleApp16.exe
C:\Users\User\Documents\Visual Studio 2017\Projects\ConsoleApp16\ConsoleApp16\bin\Debug\ConsoleApp16.pdb
C:\Users\User\Documents\Visual Studio 2017\Projects\ConsoleApp16\ConsoleApp16\obj\Debug\ConsoleApp16.csprojResolveAssemblyReference.cache
C:\Users\User\Documents\Visual Studio 2017\Projects\ConsoleApp16\ConsoleApp16\obj\Debug\ConsoleApp16.exe
C:\Users\User\Documents\Visual Studio 2017\Projects\ConsoleApp16\ConsoleApp16\obj\Debug\ConsoleApp16.pdb
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bf55f2b7831d3484a66687d520270eca8bb4d2ac
Binary file not shown.
Loading