diff --git a/fordulo_3/ProgVerseny_3_ford_2025.pdf b/fordulo_3/ProgVerseny_3_ford_2025.pdf new file mode 100644 index 0000000..2a6458f Binary files /dev/null and b/fordulo_3/ProgVerseny_3_ford_2025.pdf differ diff --git a/fordulo_3/Program/.vs/Program/CopilotIndices/17.13.431.34963/CodeChunks.db b/fordulo_3/Program/.vs/Program/CopilotIndices/17.13.431.34963/CodeChunks.db new file mode 100644 index 0000000..0459d98 Binary files /dev/null and b/fordulo_3/Program/.vs/Program/CopilotIndices/17.13.431.34963/CodeChunks.db differ diff --git a/fordulo_3/Program/.vs/Program/CopilotIndices/17.13.431.34963/SemanticSymbols.db b/fordulo_3/Program/.vs/Program/CopilotIndices/17.13.431.34963/SemanticSymbols.db new file mode 100644 index 0000000..08cf2fb Binary files /dev/null and b/fordulo_3/Program/.vs/Program/CopilotIndices/17.13.431.34963/SemanticSymbols.db differ diff --git a/fordulo_3/Program/.vs/Program/FileContentIndex/709cd04e-3822-46cd-877c-58cf2aa34676.vsidx b/fordulo_3/Program/.vs/Program/FileContentIndex/709cd04e-3822-46cd-877c-58cf2aa34676.vsidx new file mode 100644 index 0000000..fd59670 Binary files /dev/null and b/fordulo_3/Program/.vs/Program/FileContentIndex/709cd04e-3822-46cd-877c-58cf2aa34676.vsidx differ diff --git a/fordulo_3/Program/.vs/Program/FileContentIndex/c5e1a060-b5a3-4a37-83b6-4d15ff12fdfb.vsidx b/fordulo_3/Program/.vs/Program/FileContentIndex/c5e1a060-b5a3-4a37-83b6-4d15ff12fdfb.vsidx new file mode 100644 index 0000000..2474a64 Binary files /dev/null and b/fordulo_3/Program/.vs/Program/FileContentIndex/c5e1a060-b5a3-4a37-83b6-4d15ff12fdfb.vsidx differ diff --git a/fordulo_3/Program/.vs/Program/v17/.suo b/fordulo_3/Program/.vs/Program/v17/.suo new file mode 100644 index 0000000..bd5a771 Binary files /dev/null and b/fordulo_3/Program/.vs/Program/v17/.suo differ diff --git a/fordulo_3/Program/.vs/Program/v17/DocumentLayout.backup.json b/fordulo_3/Program/.vs/Program/v17/DocumentLayout.backup.json new file mode 100644 index 0000000..61aac78 --- /dev/null +++ b/fordulo_3/Program/.vs/Program/v17/DocumentLayout.backup.json @@ -0,0 +1,54 @@ +{ + "Version": 1, + "WorkspaceRootPath": "E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_3\\Program\\", + "Documents": [ + { + "AbsoluteMoniker": "D:0:0:{6A74A9DE-500D-46FF-859A-18F4A752D2A5}|Program.csproj|e:\\h\u00E1zi\\13.oszt\u00E1ly\\neumann_verseny\\fordulo_3\\program\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{6A74A9DE-500D-46FF-859A-18F4A752D2A5}|Program.csproj|solutionrelative:program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{6A74A9DE-500D-46FF-859A-18F4A752D2A5}|Program.csproj|e:\\h\u00E1zi\\13.oszt\u00E1ly\\neumann_verseny\\fordulo_3\\program\\sorozat.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{6A74A9DE-500D-46FF-859A-18F4A752D2A5}|Program.csproj|solutionrelative:sorozat.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + } + ], + "DocumentGroupContainers": [ + { + "Orientation": 0, + "VerticalTabListWidth": 256, + "DocumentGroups": [ + { + "DockedWidth": 200, + "SelectedChildIndex": 1, + "Children": [ + { + "$type": "Document", + "DocumentIndex": 1, + "Title": "Sorozat.cs", + "DocumentMoniker": "E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_3\\Program\\Sorozat.cs", + "RelativeDocumentMoniker": "Sorozat.cs", + "ToolTip": "E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_3\\Program\\Sorozat.cs", + "RelativeToolTip": "Sorozat.cs", + "ViewState": "AgIAAAgAAAAAAAAAAAAxwBkAAAAcAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2025-03-12T12:59:58.311Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 0, + "Title": "Program.cs", + "DocumentMoniker": "E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_3\\Program\\Program.cs", + "RelativeDocumentMoniker": "Program.cs", + "ToolTip": "E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_3\\Program\\Program.cs", + "RelativeToolTip": "Program.cs", + "ViewState": "AgIAAAQAAAAAAAAAAAAUwCEAAABqAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2025-03-12T12:54:16.847Z", + "EditorCaption": "" + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/fordulo_3/Program/.vs/Program/v17/DocumentLayout.json b/fordulo_3/Program/.vs/Program/v17/DocumentLayout.json new file mode 100644 index 0000000..61aac78 --- /dev/null +++ b/fordulo_3/Program/.vs/Program/v17/DocumentLayout.json @@ -0,0 +1,54 @@ +{ + "Version": 1, + "WorkspaceRootPath": "E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_3\\Program\\", + "Documents": [ + { + "AbsoluteMoniker": "D:0:0:{6A74A9DE-500D-46FF-859A-18F4A752D2A5}|Program.csproj|e:\\h\u00E1zi\\13.oszt\u00E1ly\\neumann_verseny\\fordulo_3\\program\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{6A74A9DE-500D-46FF-859A-18F4A752D2A5}|Program.csproj|solutionrelative:program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{6A74A9DE-500D-46FF-859A-18F4A752D2A5}|Program.csproj|e:\\h\u00E1zi\\13.oszt\u00E1ly\\neumann_verseny\\fordulo_3\\program\\sorozat.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{6A74A9DE-500D-46FF-859A-18F4A752D2A5}|Program.csproj|solutionrelative:sorozat.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + } + ], + "DocumentGroupContainers": [ + { + "Orientation": 0, + "VerticalTabListWidth": 256, + "DocumentGroups": [ + { + "DockedWidth": 200, + "SelectedChildIndex": 1, + "Children": [ + { + "$type": "Document", + "DocumentIndex": 1, + "Title": "Sorozat.cs", + "DocumentMoniker": "E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_3\\Program\\Sorozat.cs", + "RelativeDocumentMoniker": "Sorozat.cs", + "ToolTip": "E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_3\\Program\\Sorozat.cs", + "RelativeToolTip": "Sorozat.cs", + "ViewState": "AgIAAAgAAAAAAAAAAAAxwBkAAAAcAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2025-03-12T12:59:58.311Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 0, + "Title": "Program.cs", + "DocumentMoniker": "E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_3\\Program\\Program.cs", + "RelativeDocumentMoniker": "Program.cs", + "ToolTip": "E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_3\\Program\\Program.cs", + "RelativeToolTip": "Program.cs", + "ViewState": "AgIAAAQAAAAAAAAAAAAUwCEAAABqAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2025-03-12T12:54:16.847Z", + "EditorCaption": "" + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/fordulo_3/Program/App.config b/fordulo_3/Program/App.config new file mode 100644 index 0000000..193aecc --- /dev/null +++ b/fordulo_3/Program/App.config @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8" ?> +<configuration> + <startup> + <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" /> + </startup> +</configuration> \ No newline at end of file diff --git a/fordulo_3/Program/Program.cs b/fordulo_3/Program/Program.cs new file mode 100644 index 0000000..fe5abcc --- /dev/null +++ b/fordulo_3/Program/Program.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Program +{ + class Program + { + static void Main(string[] args) + { + Sorozat leghosszabb = new Sorozat(77031); + leghosszabb.TagokKiszamitasa(leghosszabb.KezdoErtek); + + int max = 110000; + int min = 100000; + + + for (int i = min; i < max; i++) + { + Sorozat sorozat = new Sorozat(i); + sorozat.TagokKiszamitasa(sorozat.KezdoErtek); + if (sorozat.Tagok.Count > leghosszabb.Tagok.Count) + { + leghosszabb = new Sorozat(sorozat); + } + } + + + // mivel 1.000.000 számot kell megvizsgálin ezért ez a fajta megoldás nem jó + //Sorozat leghosszabb = sorozatok.OrderByDescending(x => x.Tagok.Count).First(); + + Console.WriteLine($"2. feladat megoldás: {leghosszabb.KezdoErtek}|{leghosszabb.Tagok.Count}"); + } + } +} diff --git a/fordulo_3/Program/Program.csproj b/fordulo_3/Program/Program.csproj new file mode 100644 index 0000000..4c5b7d0 --- /dev/null +++ b/fordulo_3/Program/Program.csproj @@ -0,0 +1,54 @@ +<?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>{6A74A9DE-500D-46FF-859A-18F4A752D2A5}</ProjectGuid> + <OutputType>Exe</OutputType> + <RootNamespace>Program</RootNamespace> + <AssemblyName>Program</AssemblyName> + <TargetFrameworkVersion>v4.8</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" /> + <Compile Include="Sorozat.cs" /> + </ItemGroup> + <ItemGroup> + <None Include="App.config" /> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> +</Project> \ No newline at end of file diff --git a/fordulo_3/Program/Program.sln b/fordulo_3/Program/Program.sln new file mode 100644 index 0000000..9d5e6e4 --- /dev/null +++ b/fordulo_3/Program/Program.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.13.35818.85 d17.13 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Program", "Program.csproj", "{6A74A9DE-500D-46FF-859A-18F4A752D2A5}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {6A74A9DE-500D-46FF-859A-18F4A752D2A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6A74A9DE-500D-46FF-859A-18F4A752D2A5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6A74A9DE-500D-46FF-859A-18F4A752D2A5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6A74A9DE-500D-46FF-859A-18F4A752D2A5}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {66F1EDAE-14B5-40E6-A725-9281D19AFDF6} + EndGlobalSection +EndGlobal diff --git a/fordulo_3/Program/Properties/AssemblyInfo.cs b/fordulo_3/Program/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..347a03f --- /dev/null +++ b/fordulo_3/Program/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +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("Program")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Program")] +[assembly: AssemblyCopyright("Copyright © 2025")] +[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("6a74a9de-500d-46ff-859a-18f4a752d2a5")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/fordulo_3/Program/Sorozat.cs b/fordulo_3/Program/Sorozat.cs new file mode 100644 index 0000000..2a67e94 --- /dev/null +++ b/fordulo_3/Program/Sorozat.cs @@ -0,0 +1,71 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Program +{ + class Sorozat + { + public int KezdoErtek; + + public List<int> Tagok = new List<int>(); + + int[] kettoHatvanyok = new int[] { 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576, 2097152, 4194304, 8388608 }; + + public int TagokKiszamitasa(int ertek) + { + int ujertek; + + if (kettoHatvanyok.Contains(ertek)) + { + int index = 0; + while (kettoHatvanyok[index] != ertek) + { + index++; + } + + KettoHatvanyokTagokHozzaAdasa(index); + + return 1; + } + + if (ertek == 1) { + Tagok.Add(ertek); + return 1; + } + + if (ertek % 2 == 0) + { + ujertek = ertek / 2; + + } else + { + ujertek = ertek * 3 + 1; + } + + Tagok.Add(ertek); + return TagokKiszamitasa(ujertek); + } + + public void KettoHatvanyokTagokHozzaAdasa(int index) + { + for (int i = index; i >= 0; i--) + { + Tagok.Add(kettoHatvanyok[i]); + } + } + + public Sorozat(Sorozat sorozat) + { + KezdoErtek = sorozat.KezdoErtek; + Tagok = sorozat.Tagok; + } + + public Sorozat(int kezdoErtek) + { + this.KezdoErtek = kezdoErtek; + } + } +} diff --git a/fordulo_3/Program/bin/Debug/Program.exe b/fordulo_3/Program/bin/Debug/Program.exe new file mode 100644 index 0000000..46577b5 Binary files /dev/null and b/fordulo_3/Program/bin/Debug/Program.exe differ diff --git a/fordulo_3/Program/bin/Debug/Program.exe.config b/fordulo_3/Program/bin/Debug/Program.exe.config new file mode 100644 index 0000000..193aecc --- /dev/null +++ b/fordulo_3/Program/bin/Debug/Program.exe.config @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8" ?> +<configuration> + <startup> + <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" /> + </startup> +</configuration> \ No newline at end of file diff --git a/fordulo_3/Program/bin/Debug/Program.pdb b/fordulo_3/Program/bin/Debug/Program.pdb new file mode 100644 index 0000000..7fac86a Binary files /dev/null and b/fordulo_3/Program/bin/Debug/Program.pdb differ diff --git a/fordulo_3/Program/obj/Debug/.NETFramework,Version=v4.8.AssemblyAttributes.cs b/fordulo_3/Program/obj/Debug/.NETFramework,Version=v4.8.AssemblyAttributes.cs new file mode 100644 index 0000000..15efebf --- /dev/null +++ b/fordulo_3/Program/obj/Debug/.NETFramework,Version=v4.8.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// <autogenerated /> +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] diff --git a/fordulo_3/Program/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/fordulo_3/Program/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..388e3ef Binary files /dev/null and b/fordulo_3/Program/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/fordulo_3/Program/obj/Debug/Program.csproj.AssemblyReference.cache b/fordulo_3/Program/obj/Debug/Program.csproj.AssemblyReference.cache new file mode 100644 index 0000000..6943b8f Binary files /dev/null and b/fordulo_3/Program/obj/Debug/Program.csproj.AssemblyReference.cache differ diff --git a/fordulo_3/Program/obj/Debug/Program.csproj.CoreCompileInputs.cache b/fordulo_3/Program/obj/Debug/Program.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..174d581 --- /dev/null +++ b/fordulo_3/Program/obj/Debug/Program.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +52261ac204714890afe2467c25b9765789d39c141c743f2c478f13be997c8941 diff --git a/fordulo_3/Program/obj/Debug/Program.csproj.FileListAbsolute.txt b/fordulo_3/Program/obj/Debug/Program.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..1248eb9 --- /dev/null +++ b/fordulo_3/Program/obj/Debug/Program.csproj.FileListAbsolute.txt @@ -0,0 +1,7 @@ +E:\Házi\13.osztály\Neumann_Verseny\fordulo_3\Program\bin\Debug\Program.exe.config +E:\Házi\13.osztály\Neumann_Verseny\fordulo_3\Program\bin\Debug\Program.exe +E:\Házi\13.osztály\Neumann_Verseny\fordulo_3\Program\bin\Debug\Program.pdb +E:\Házi\13.osztály\Neumann_Verseny\fordulo_3\Program\obj\Debug\Program.csproj.AssemblyReference.cache +E:\Házi\13.osztály\Neumann_Verseny\fordulo_3\Program\obj\Debug\Program.csproj.CoreCompileInputs.cache +E:\Házi\13.osztály\Neumann_Verseny\fordulo_3\Program\obj\Debug\Program.exe +E:\Házi\13.osztály\Neumann_Verseny\fordulo_3\Program\obj\Debug\Program.pdb diff --git a/fordulo_3/Program/obj/Debug/Program.exe b/fordulo_3/Program/obj/Debug/Program.exe new file mode 100644 index 0000000..46577b5 Binary files /dev/null and b/fordulo_3/Program/obj/Debug/Program.exe differ diff --git a/fordulo_3/Program/obj/Debug/Program.pdb b/fordulo_3/Program/obj/Debug/Program.pdb new file mode 100644 index 0000000..7fac86a Binary files /dev/null and b/fordulo_3/Program/obj/Debug/Program.pdb differ diff --git a/megoldasok.md b/megoldasok.md index c73cc76..e33052a 100644 --- a/megoldasok.md +++ b/megoldasok.md @@ -30,7 +30,7 @@ - b: `alfa` - c: `6` - d: `4` -- e: `98` +- e: `102` ### 3. feladat - a: `213`