From b45ae9618612528d0c25f08e5afdfd12fa2a73f5 Mon Sep 17 00:00:00 2001 From: szabotamasd Date: Tue, 20 May 2025 14:25:44 +0200 Subject: [PATCH] Add project files. --- Helsinki1952.sln | 25 ++++++ Helsinki1952/App.config | 6 ++ Helsinki1952/Helsinki1952.csproj | 57 +++++++++++++ Helsinki1952/Olimpia.cs | 25 ++++++ Helsinki1952/Program.cs | 102 ++++++++++++++++++++++++ Helsinki1952/Properties/AssemblyInfo.cs | 33 ++++++++ Helsinki1952/helsinki.txt | 64 +++++++++++++++ 7 files changed, 312 insertions(+) create mode 100644 Helsinki1952.sln create mode 100644 Helsinki1952/App.config create mode 100644 Helsinki1952/Helsinki1952.csproj create mode 100644 Helsinki1952/Olimpia.cs create mode 100644 Helsinki1952/Program.cs create mode 100644 Helsinki1952/Properties/AssemblyInfo.cs create mode 100644 Helsinki1952/helsinki.txt diff --git a/Helsinki1952.sln b/Helsinki1952.sln new file mode 100644 index 0000000..2f77dc1 --- /dev/null +++ b/Helsinki1952.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.13.35931.197 d17.13 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Helsinki1952", "Helsinki1952\Helsinki1952.csproj", "{042640DD-BE35-4669-8485-E06367232EA8}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {042640DD-BE35-4669-8485-E06367232EA8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {042640DD-BE35-4669-8485-E06367232EA8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {042640DD-BE35-4669-8485-E06367232EA8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {042640DD-BE35-4669-8485-E06367232EA8}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {5BBECC6B-438C-4900-AE70-0799E362E5E1} + EndGlobalSection +EndGlobal diff --git a/Helsinki1952/App.config b/Helsinki1952/App.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/Helsinki1952/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Helsinki1952/Helsinki1952.csproj b/Helsinki1952/Helsinki1952.csproj new file mode 100644 index 0000000..83ce234 --- /dev/null +++ b/Helsinki1952/Helsinki1952.csproj @@ -0,0 +1,57 @@ + + + + + Debug + AnyCPU + {042640DD-BE35-4669-8485-E06367232EA8} + Exe + Helsinki1952 + Helsinki1952 + v4.7.2 + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Helsinki1952/Olimpia.cs b/Helsinki1952/Olimpia.cs new file mode 100644 index 0000000..adba131 --- /dev/null +++ b/Helsinki1952/Olimpia.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Helsinki1952 +{ + internal class Olimpia + { + public int helyezes; + public int olimpikonok; + public string sport; + public string versenyszam; + + public Olimpia(string adatsor) + { + string[] t = adatsor.Split(' '); + helyezes = int.Parse(t[0]); + olimpikonok = int.Parse(t[1]); + sport = t[2]; + versenyszam = t[3]; + } + } +} \ No newline at end of file diff --git a/Helsinki1952/Program.cs b/Helsinki1952/Program.cs new file mode 100644 index 0000000..56cce65 --- /dev/null +++ b/Helsinki1952/Program.cs @@ -0,0 +1,102 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.IO; +using System.Threading.Tasks; + +namespace Helsinki1952 +{ + internal class Program + { + public static List helsinkiList; + static void Main(string[] args) + { + + Feladat2(); + Feladat3(); + Feladat4(); + Feladat5(); + + + } + + private static void Feladat5() + { + int opont = 0; + foreach (Olimpia hs in helsinkiList) + { + if (hs.helyezes == 1) + { + opont += 7; + } + else if (hs.helyezes == 2) + { + opont += 5; + } + else if (hs.helyezes == 3) + { + opont += 4; + } + else if (hs.helyezes == 4) + { + opont += 3; + } + else if (hs.helyezes == 5) + { + opont += 2; + } + else { opont += 1; } + } + Console.WriteLine("5. feladat:"); + Console.WriteLine($"Olimpiai pontok száma: {opont}"); + } + + private static void Feladat4() + { + int arany = 0; + int ezust = 0; + int bronz = 0; + + foreach (Olimpia hs in helsinkiList) + { + if (hs.helyezes == 1) + { + arany++; + } + else if (hs.helyezes == 2) + { + ezust++; + } + else if (hs.helyezes == 3) + { + bronz++; + } + else { break; } + } + int osszes = arany + ezust + bronz; + Console.WriteLine("4. feladat:"); + Console.WriteLine($"Arany: {arany}"); + Console.WriteLine($"Ezust: {ezust}"); + Console.WriteLine($"Bronz: {bronz}"); + Console.WriteLine($"Összesen: {osszes}"); + } + + private static void Feladat3() + { + Console.WriteLine("3. feladat:"); + Console.WriteLine($"PontszerzÅ‘ helyezések száma: {helsinkiList.Count}"); + } + + private static void Feladat2() + { + helsinkiList = new List(); + StreamReader streamReader = new StreamReader(@"..\..\helsinki.txt"); + while (!streamReader.EndOfStream) + { + helsinkiList.Add(new Olimpia(streamReader.ReadLine())); + } + streamReader.Close(); + } + } +} diff --git a/Helsinki1952/Properties/AssemblyInfo.cs b/Helsinki1952/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..bf6a1ec --- /dev/null +++ b/Helsinki1952/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("Helsinki1952")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Helsinki1952")] +[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("042640dd-be35-4669-8485-e06367232ea8")] + +// 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/Helsinki1952/helsinki.txt b/Helsinki1952/helsinki.txt new file mode 100644 index 0000000..4145160 --- /dev/null +++ b/Helsinki1952/helsinki.txt @@ -0,0 +1,64 @@ +1 1 atletika kalapacsvetes +1 1 uszas 400m_gyorsuszas +1 1 birkozas kotott_fogas_legsuly +1 1 torna talajtorna +1 1 torna felemas_korlat +1 1 vivas kardvivas_egyeni +1 1 okolvivas nagyvaltosuly +1 1 uszas 200m_melluszas +1 1 birkozas kotott_fogas_valtosuly +1 1 uszas 100m_gyorsuszas +1 1 sportloveszet onmukodo_sportpisztoly +1 15 labdarugas ferfi_csapat +1 3 ottusa ferfi_csapat +1 6 vivas kardvivas_csapat +1 5 uszas 4x100m_gyorsuszo_valto +1 13 vizilabda ferfi_csapat +2 1 ottusa ottusa_egyeni +2 1 vivas torvivas_egyeni +2 1 vivas kardvivas_egyeni +2 1 sportloveszet onmukodo_sportpisztoly +2 1 uszas 400m_gyorsuszas +2 1 uszas 200m_melluszas +2 1 kajakkenu kenu_egyes_10000m +2 1 kajakkenu kajak_egyes_1000m +2 1 birkozas kotott_fogas_pehelysuly +2 8 torna noi_osszetett_csapat +3 1 sportloveszet sportpisztoly +3 1 vivas kardvivas_egyeni +3 1 atletika tavolugras +3 1 birkozas szabad_fogas_kozepsuly +3 1 torna felemas_korlat +3 1 torna osszetett_egyeni +3 1 torna gerenda +3 1 torna talajtorna +3 1 atletika kalapacsvetes +3 1 atletika 50km_gyaloglas +3 1 ottusa ottusa_egyeni +3 1 uszas 100m_gyorsuszas +3 4 atletika 4x100m_valtofutas +3 2 kajakkenu kenu_kettes_10000m +3 8 torna keziszer_csapat +3 6 vivas torvivas_csapat +4 1 torna gerenda +4 1 uszas 200m_mell +4 1 birkozas kotottfogas_felnehezsuly +4 1 torna talaj +4 1 birkozas kotottfogas_kozepsuly +4 1 birkozas kotottfogas_konnyusuly +5 1 okolvivas pehelysuly +5 1 okolvivas konnyusuly +5 1 uszas 100m_gyors +5 1 atletika diszkoszvetes +5 1 vivas parbajtor_egyeni +5 2 kajak–kenu kenu_kettes_1000m +5 2 kerekparozas ketuleses_verseny +5 4 uszas 4×200m_gyorsvalto +5 5 vivas parbajtor_csapat +6 1 birkozas kotottfogas_legsuly +6 1 kajak–kenu kajak_egyes_500m +6 1 torna osszetett_egyeni +6 1 kerekparozas repuloverseny +6 1 uszas 400m_gyors +6 1 torna felemaskorlat +6 8 torna osszetett_csapat \ No newline at end of file