diff --git a/MeccsDoga.sln b/MeccsDoga.sln new file mode 100644 index 0000000..5f19f11 --- /dev/null +++ b/MeccsDoga.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.11.35312.102 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MeccsDoga", "MeccsDoga\MeccsDoga.csproj", "{9B02A318-1117-4C46-AC44-5E97A5DC5B3D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {9B02A318-1117-4C46-AC44-5E97A5DC5B3D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9B02A318-1117-4C46-AC44-5E97A5DC5B3D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9B02A318-1117-4C46-AC44-5E97A5DC5B3D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9B02A318-1117-4C46-AC44-5E97A5DC5B3D}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {F2FA4E20-43F7-469D-9A7A-294A3579A485} + EndGlobalSection +EndGlobal diff --git a/MeccsDoga/App.config b/MeccsDoga/App.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/MeccsDoga/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/MeccsDoga/MeccsDoga.csproj b/MeccsDoga/MeccsDoga.csproj new file mode 100644 index 0000000..9776db0 --- /dev/null +++ b/MeccsDoga/MeccsDoga.csproj @@ -0,0 +1,57 @@ + + + + + Debug + AnyCPU + {9B02A318-1117-4C46-AC44-5E97A5DC5B3D} + Exe + MeccsDoga + MeccsDoga + 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/MeccsDoga/Program.cs b/MeccsDoga/Program.cs new file mode 100644 index 0000000..70bd8da --- /dev/null +++ b/MeccsDoga/Program.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.Design; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MeccsDoga +{ + internal class Program + { + static void Main(string[] args) + { + Console.ForegroundColor = ConsoleColor.DarkMagenta; + //Beolvasás első + string[] sorok = File.ReadAllLines(@"C:\Users\szabotamasd\Downloads\merkozesek.txt"); + Console.WriteLine(sorok[0]); + Console.WriteLine("Add meg egy forduló sorszámát (1-20):"); + int fordulo = int.Parse(Console.ReadLine()); + Console.WriteLine($"2. feladat \nA {fordulo}. forduló mérkőzései: "); + int hazai = 0; + int vendeg = 0; + int dontetlen = 0; + foreach (var sor in sorok) + { + string[] adatatsor = sor.Split(' '); + int fordsor = int.Parse(adatatsor[0]); + if (fordsor == fordulo) + { + Console.WriteLine($"{adatatsor[3]} - {adatatsor[4]}: {adatatsor[1]}-{adatatsor[2]}"); + } + if (int.Parse(adatatsor[1]) > int.Parse(adatatsor[2])) + { + hazai++; + } + else if ((int.Parse(adatatsor[1]) == int.Parse(adatatsor[2]))) + { + dontetlen++; + } + else { vendeg++; } + } + Console.WriteLine("3. feladat"); + Console.WriteLine($"Hazai győzelem: {hazai} mérkőzésen"); + Console.WriteLine($"Vendég győzelem: {vendeg} mérkőzésen"); + Console.WriteLine($"Döntetlen: {dontetlen} mérkőzésen"); + + Console.WriteLine("\nMásik megoldás Saját olvasóval:"); + SajatBeolvaso sajatBeolvaso = new SajatBeolvaso(); + sajatBeolvaso.Vegrehajt(); + + } + } +} diff --git a/MeccsDoga/Properties/AssemblyInfo.cs b/MeccsDoga/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..1913c23 --- /dev/null +++ b/MeccsDoga/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("MeccsDoga")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("MeccsDoga")] +[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("9b02a318-1117-4c46-ac44-5e97a5dc5b3d")] + +// 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/MeccsDoga/SajatBeolvaso.cs b/MeccsDoga/SajatBeolvaso.cs new file mode 100644 index 0000000..ed5a311 --- /dev/null +++ b/MeccsDoga/SajatBeolvaso.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MeccsDoga +{ + internal class SajatBeolvaso + { + public void Vegrehajt() + { + StreamReader olvaso = new StreamReader("merkozesek.txt"); + //string elsosor = olvaso.ReadLine(); + //Console.WriteLine(elsosor); + int fordulo = int.Parse(Console.ReadLine()); + Console.WriteLine($"2. feladat \nA {fordulo}. forduló mérkőzései: "); + int hazai = 0; + int vendeg = 0; + int dontetlen = 0; + while (!olvaso.EndOfStream) + { + string sor = olvaso.ReadLine(); + string[] adatatsor = sor.Split(' '); + int fordsor = int.Parse(adatatsor[0]); + if (fordsor == fordulo) + { + Console.WriteLine($"{adatatsor[3]} - {adatatsor[4]}: {adatatsor[1]}-{adatatsor[2]}"); + } + if (int.Parse(adatatsor[1]) > int.Parse(adatatsor[2])) + { + hazai++; + } + else if ((int.Parse(adatatsor[1]) == int.Parse(adatatsor[2]))) + { + dontetlen++; + } + else { vendeg++; } + } + olvaso.Close(); + } + } +}