bastien.monsarrat 6 năm trước cách đây
mục cha
commit
5fad011f31
5 tập tin đã thay đổi với 147 bổ sung8 xóa
  1. 14 8
      Adv2018.sln
  2. 6 0
      D14.1/App.config
  3. 53 0
      D14.1/D14.1.csproj
  4. 38 0
      D14.1/Program.cs
  5. 36 0
      D14.1/Properties/AssemblyInfo.cs

+ 14 - 8
Adv2018.sln

@@ -51,13 +51,15 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "D11.2", "D11.2\D11.2.csproj
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "D12.1", "D12.1\D12.1.csproj", "{6DE5A0FF-CE37-4454-B6CE-7BA4CBFC4C69}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "D12.2", "D12.2\D12.2.csproj", "{86070C5D-C898-4A3D-882C-611B7A19709C}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "D12.2", "D12.2\D12.2.csproj", "{86070C5D-C898-4A3D-882C-611B7A19709C}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "D13.1", "D13.1\D13.1.csproj", "{3CF576D2-C0DA-4781-917C-010792190952}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "D13.1", "D13.1\D13.1.csproj", "{3CF576D2-C0DA-4781-917C-010792190952}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "D13.2", "D13.2\D13.2.csproj", "{50E6029A-7019-44A3-B790-D2F556A0FF2E}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "D13.2", "D13.2\D13.2.csproj", "{50E6029A-7019-44A3-B790-D2F556A0FF2E}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "D13.Bonus", "D13.Bonus\D13.Bonus.csproj", "{34DBA00B-F1A6-438B-B610-19FC8436F7DE}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "D13.Bonus", "D13.Bonus\D13.Bonus.csproj", "{1FC3EF39-4B1A-4792-801C-560A83E9461C}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "D14.1", "D14.1\D14.1.csproj", "{FBA155A3-A591-4C0B-B89F-1C789340CC0D}"
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -173,10 +175,14 @@ Global
 		{50E6029A-7019-44A3-B790-D2F556A0FF2E}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{50E6029A-7019-44A3-B790-D2F556A0FF2E}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{50E6029A-7019-44A3-B790-D2F556A0FF2E}.Release|Any CPU.Build.0 = Release|Any CPU
-		{34DBA00B-F1A6-438B-B610-19FC8436F7DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{34DBA00B-F1A6-438B-B610-19FC8436F7DE}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{34DBA00B-F1A6-438B-B610-19FC8436F7DE}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{34DBA00B-F1A6-438B-B610-19FC8436F7DE}.Release|Any CPU.Build.0 = Release|Any CPU
+		{1FC3EF39-4B1A-4792-801C-560A83E9461C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{1FC3EF39-4B1A-4792-801C-560A83E9461C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{1FC3EF39-4B1A-4792-801C-560A83E9461C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{1FC3EF39-4B1A-4792-801C-560A83E9461C}.Release|Any CPU.Build.0 = Release|Any CPU
+		{FBA155A3-A591-4C0B-B89F-1C789340CC0D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{FBA155A3-A591-4C0B-B89F-1C789340CC0D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{FBA155A3-A591-4C0B-B89F-1C789340CC0D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{FBA155A3-A591-4C0B-B89F-1C789340CC0D}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

+ 6 - 0
D14.1/App.config

@@ -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 - 0
D14.1/D14.1.csproj

@@ -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>{FBA155A3-A591-4C0B-B89F-1C789340CC0D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <RootNamespace>D14._1</RootNamespace>
+    <AssemblyName>D14.1</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>

+ 38 - 0
D14.1/Program.cs

@@ -0,0 +1,38 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace D14._1
+{
+    class Program
+    {
+        static void Main(string[] args)
+        {
+            if (args.Length == 0) return;
+            int input = int.Parse(args[0]);
+
+            int elf1 = 0;
+            int elf2 = 1;
+
+            List<int> recipes = new List<int>() { 3, 7 };
+
+            for (int _ = 0; _ < 10 + input; ++_)
+            {
+                int nrecipe = recipes[elf1] + recipes[elf2];
+                if (nrecipe < 10) recipes.Add(nrecipe);
+                else recipes.AddRange(new[] { 1, nrecipe - 10 });
+
+                elf1 = (elf1 + 1 + recipes[elf1]) % recipes.Count;
+                elf2 = (elf2 + 1 + recipes[elf2]) % recipes.Count;
+            }
+
+            string result = "";
+            for (int i = input; i < 10 + input; ++i)
+                result += recipes[i].ToString();
+
+            Console.WriteLine(result);
+        }
+    }
+}

+ 36 - 0
D14.1/Properties/AssemblyInfo.cs

@@ -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("D14.1")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("D14.1")]
+[assembly: AssemblyCopyright("Copyright ©  2019")]
+[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("fba155a3-a591-4c0b-b89f-1c789340cc0d")]
+
+// 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")]