-
Notifications
You must be signed in to change notification settings - Fork 10
Герасимов Александр Сергеевич 2/42 #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ALeksandr13254
wants to merge
1
commit into
ISUCT:master
Choose a base branch
from
ALeksandr13254:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| | ||
| Microsoft Visual Studio Solution File, Format Version 12.00 | ||
| # Visual Studio Version 16 | ||
| VisualStudioVersion = 16.0.29806.167 | ||
| MinimumVisualStudioVersion = 10.0.40219.1 | ||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Exam", "Экзамен\Exam.csproj", "{F7F67798-D32F-4AF0-9A31-243104DF7CFE}" | ||
| EndProject | ||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "XUnitTest", "XUnitTest\XUnitTest.csproj", "{FA8A3035-61D6-4A6A-9D04-8EC6F1B5E2B1}" | ||
| EndProject | ||
| Global | ||
| GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
| Debug|Any CPU = Debug|Any CPU | ||
| Release|Any CPU = Release|Any CPU | ||
| EndGlobalSection | ||
| GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
| {F7F67798-D32F-4AF0-9A31-243104DF7CFE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {F7F67798-D32F-4AF0-9A31-243104DF7CFE}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {F7F67798-D32F-4AF0-9A31-243104DF7CFE}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {F7F67798-D32F-4AF0-9A31-243104DF7CFE}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| {FA8A3035-61D6-4A6A-9D04-8EC6F1B5E2B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {FA8A3035-61D6-4A6A-9D04-8EC6F1B5E2B1}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {FA8A3035-61D6-4A6A-9D04-8EC6F1B5E2B1}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {FA8A3035-61D6-4A6A-9D04-8EC6F1B5E2B1}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| EndGlobalSection | ||
| GlobalSection(SolutionProperties) = preSolution | ||
| HideSolutionNode = FALSE | ||
| EndGlobalSection | ||
| GlobalSection(ExtensibilityGlobals) = postSolution | ||
| SolutionGuid = {C03E751C-2F37-49CE-A64D-56885F385FC5} | ||
| EndGlobalSection | ||
| EndGlobal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <OutputType>Exe</OutputType> | ||
| <TargetFramework>netcoreapp3.1</TargetFramework> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="xunit" Version="2.4.1" /> | ||
| </ItemGroup> | ||
|
|
||
| </Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
|
|
||
| namespace Examen | ||
| { | ||
| public class Map | ||
| { | ||
| public static void Main(string[] args) | ||
| { | ||
| Dictionary<string, Dictionary<string, Dictionary<string, string>>> words = new Dictionary<string, Dictionary<string, Dictionary<string, string>>>(); | ||
| words.Add("a", new Dictionary<string, Dictionary<string, string>>()); | ||
| words["a"].Add("b", new Dictionary<string, string>()); | ||
| words["a"].Add("", new Dictionary<string, string>()); | ||
| words["a"]["b"].Add("c", "12"); | ||
| words["a"]["b"].Add("d", "Hello World"); | ||
| words["a"][""].Add("e", "1,2,3"); | ||
| foreach (KeyValuePair<string, string> d in FuncFlat(words)) | ||
| { | ||
| Console.WriteLine(d.Key + " : " + d.Value); | ||
| } | ||
| } | ||
| public static Dictionary<string, string> FuncFlat(Dictionary<string, Dictionary<string, Dictionary<string, string>>> words) | ||
| { | ||
| Dictionary<string, string> wordsFlat = new Dictionary<string, string>(); | ||
| foreach (string a in words.Keys) | ||
| { | ||
| foreach (string b in words[a].Keys) | ||
| { | ||
| foreach (KeyValuePair<string, string> c in words[a][b]) | ||
| { | ||
| string flat = a; | ||
| if (b != "") | ||
| { | ||
| flat += "/" + b + "/" + c.Key; | ||
| } | ||
| else | ||
| { | ||
| flat += b + "/" + c.Key; | ||
| } | ||
| wordsFlat.Add(flat, c.Value); | ||
| } | ||
| } | ||
| } | ||
| return wordsFlat; | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,12 @@ | ||
| # exam_42_2020 | ||
| # exam_42_2020 | ||
| Дан словарь (Map) – необходимо развернуть словарь в плоскую структуру. | ||
|
|
||
| Дано: | ||
|
|
||
| { 'a': { 'b': { 'c': 12, 'd': 'Hello World' }, 'e': [1,2,3] } } | ||
|
|
||
| Ожидаемый результат | ||
|
|
||
| { 'a/b/c': 12, 'a/b/d': 'Hello World', 'a/e': [1,2,3] } | ||
|
|
||
| Герасимов Александр Сергеевич 2/42 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| using System.Collections.Generic; | ||
| using Xunit; | ||
|
|
||
| namespace Examen | ||
| { | ||
| public class UnitTest1 | ||
| { | ||
| [Fact] | ||
| public void EmptyTest() | ||
| { | ||
| Dictionary<string, Dictionary<string, Dictionary<string, string>>> words = new Dictionary<string, Dictionary<string, Dictionary<string, string>>>(); | ||
| Assert.Equal(new Dictionary<string, string>(), Map.FuncFlat(words)); | ||
| } | ||
| [Fact] | ||
| public void CorrectTest() | ||
| { | ||
| Dictionary<string, Dictionary<string, Dictionary<string, string>>> words = new Dictionary<string, Dictionary<string, Dictionary<string, string>>>(); | ||
| words.Add("a", new Dictionary<string, Dictionary<string, string>>()); | ||
| words["a"].Add("b", new Dictionary<string, string>()); | ||
| words["a"].Add("", new Dictionary<string, string>()); | ||
| words["a"]["b"].Add("c", "12"); | ||
| words["a"]["b"].Add("d", "Hello World"); | ||
| words["a"][""].Add("e", "1,2,3"); | ||
| Dictionary<string, string> correct = new Dictionary<string, string>(); | ||
| correct.Add("a/b/c", "12"); | ||
| correct.Add("a/b/d", "Hello World"); | ||
| correct.Add("a/e", "1,2,3"); | ||
| Assert.Equal(correct, Map.FuncFlat(words)); | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <TargetFramework>netcoreapp3.1</TargetFramework> | ||
|
|
||
| <IsPackable>false</IsPackable> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" /> | ||
| <PackageReference Include="xunit" Version="2.4.1" /> | ||
| <PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" /> | ||
| <PackageReference Include="coverlet.collector" Version="1.0.1" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <ProjectReference Include="..\Экзамен\Exam.csproj" /> | ||
| </ItemGroup> | ||
|
|
||
| </Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,206 @@ | ||
| # Download this file using PowerShell v3 under Windows with the following comand: | ||
| # Invoke-WebRequest https://gist.githubusercontent.com/kmorcinek/2710267/raw/ -OutFile .gitignore | ||
| # or wget: | ||
| # wget --no-check-certificate http://gist.githubusercontent.com/kmorcinek/2710267/raw/.gitignore | ||
|
|
||
| # User-specific files | ||
| *.suo | ||
| *.user | ||
| *.sln.docstates | ||
|
|
||
| # Build results | ||
|
|
||
| [Dd]ebug/ | ||
| [Rr]elease/ | ||
| x64/ | ||
| build/ | ||
| [Bb]in/ | ||
| [Oo]bj/ | ||
|
|
||
| # NuGet Packages | ||
| *.nupkg | ||
| # The packages folder can be ignored because of Package Restore | ||
| **/packages/* | ||
| # except build/, which is used as an MSBuild target. | ||
| !**/packages/build/ | ||
| # Uncomment if necessary however generally it will be regenerated when needed | ||
| #!**/packages/repositories.config | ||
|
|
||
| # MSTest test Results | ||
| [Tt]est[Rr]esult*/ | ||
| [Bb]uild[Ll]og.* | ||
|
|
||
| *_i.c | ||
| *_p.c | ||
| *.ilk | ||
| *.meta | ||
| *.obj | ||
| *.pch | ||
| *.pdb | ||
| *.pgc | ||
| *.pgd | ||
| *.rsp | ||
| *.sbr | ||
| *.tlb | ||
| *.tli | ||
| *.tlh | ||
| *.tmp | ||
| *.tmp_proj | ||
| *.log | ||
| *.vspscc | ||
| *.vssscc | ||
| .builds | ||
| *.pidb | ||
| *.log | ||
| *.scc | ||
|
|
||
| # OS generated files # | ||
| .DS_Store* | ||
| Icon? | ||
|
|
||
| # Visual C++ cache files | ||
| ipch/ | ||
| *.aps | ||
| *.ncb | ||
| *.opensdf | ||
| *.sdf | ||
| *.cachefile | ||
|
|
||
| # Visual Studio profiler | ||
| *.psess | ||
| *.vsp | ||
| *.vspx | ||
|
|
||
| # Guidance Automation Toolkit | ||
| *.gpState | ||
|
|
||
| # ReSharper is a .NET coding add-in | ||
| _ReSharper*/ | ||
| *.[Rr]e[Ss]harper | ||
|
|
||
| # TeamCity is a build add-in | ||
| _TeamCity* | ||
|
|
||
| # DotCover is a Code Coverage Tool | ||
| *.dotCover | ||
|
|
||
| # NCrunch | ||
| *.ncrunch* | ||
| .*crunch*.local.xml | ||
|
|
||
| # Installshield output folder | ||
| [Ee]xpress/ | ||
|
|
||
| # DocProject is a documentation generator add-in | ||
| DocProject/buildhelp/ | ||
| DocProject/Help/*.HxT | ||
| DocProject/Help/*.HxC | ||
| DocProject/Help/*.hhc | ||
| DocProject/Help/*.hhk | ||
| DocProject/Help/*.hhp | ||
| DocProject/Help/Html2 | ||
| DocProject/Help/html | ||
|
|
||
| # Click-Once directory | ||
| publish/ | ||
|
|
||
| # Publish Web Output | ||
| *.Publish.xml | ||
|
|
||
| # Windows Azure Build Output | ||
| csx | ||
| *.build.csdef | ||
|
|
||
| # Windows Store app package directory | ||
| AppPackages/ | ||
|
|
||
| # Others | ||
| *.Cache | ||
| ClientBin/ | ||
| # [Ss]tyle[Cc]op.* | ||
| ~$* | ||
| *~ | ||
| *.dbmdl | ||
| *.[Pp]ublish.xml | ||
| *.pfx | ||
| *.publishsettings | ||
| modulesbin/ | ||
| tempbin/ | ||
|
|
||
| # EPiServer Site file (VPP) | ||
| AppData/ | ||
|
|
||
| # RIA/Silverlight projects | ||
| Generated_Code/ | ||
|
|
||
| # Backup & report files from converting an old project file to a newer | ||
| # Visual Studio version. Backup files are not needed, because we have git ;-) | ||
| _UpgradeReport_Files/ | ||
| Backup*/ | ||
| UpgradeLog*.XML | ||
| UpgradeLog*.htm | ||
|
|
||
| # vim | ||
| *.txt~ | ||
| *.swp | ||
| *.swo | ||
|
|
||
| # svn | ||
| .svn | ||
|
|
||
| # Remainings from resolvings conflicts in Source Control | ||
| *.orig | ||
|
|
||
| # SQL Server files | ||
| **/App_Data/*.mdf | ||
| **/App_Data/*.ldf | ||
| **/App_Data/*.sdf | ||
|
|
||
|
|
||
| #LightSwitch generated files | ||
| GeneratedArtifacts/ | ||
| _Pvt_Extensions/ | ||
| ModelManifest.xml | ||
|
|
||
| # ========================= | ||
| # Windows detritus | ||
| # ========================= | ||
|
|
||
| # Windows image file caches | ||
| Thumbs.db | ||
| ehthumbs.db | ||
|
|
||
| # Folder config file | ||
| Desktop.ini | ||
|
|
||
| # Recycle Bin used on file shares | ||
| $RECYCLE.BIN/ | ||
|
|
||
| # Mac desktop service store files | ||
| .DS_Store | ||
|
|
||
| # SASS Compiler cache | ||
| .sass-cache | ||
|
|
||
| # Visual Studio 2014 CTP | ||
| **/*.sln.ide | ||
|
|
||
| # Visual Studio temp something | ||
| .vs/ | ||
|
|
||
| # VS 2015+ | ||
| *.vc.vc.opendb | ||
| *.vc.db | ||
|
|
||
| # Rider | ||
| .idea/ | ||
|
|
||
| **/node_modules/* | ||
|
|
||
| # Added by Jskonst | ||
| .vscode/ | ||
| Properties/ | ||
|
|
||
| ##### | ||
| # End of core ignore list, below put you custom 'per project' settings (patterns or path) | ||
| ##### |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.