Added footgolf homework

main
szabomarton 4 months ago
parent 8c4c4ef442
commit e64ad694cd

@ -0,0 +1,117 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
namespace ConsoleApp1
{
public class Jatekos
{
public string nev;
public string kategoria;
public string egyesulet;
public int[] pontok = { };
public Jatekos(string Nev, string Kategoria, string Egyesulet, int[] Pontok)
{
nev = Nev;
kategoria = Kategoria;
egyesulet = Egyesulet;
pontok = Pontok;
}
public static int Osszpontszam(int[] p)
{
int nulldb = 0;
foreach (var item in p)
{
if (item == 0)
{
nulldb++;
}
}
Array.Sort(p);
foreach (var item in p)
{
Console.WriteLine(item);
}
int x = p.Sum();
int legkisebb = p.Min();
int legkisebb2 = p[0];
if (nulldb == 0)
{
}
for (int i = 0; i < p.Length; i++)
{
if (legkisebb2 > p[i] && p[i] >= legkisebb)
{
legkisebb2 = p[i];
}
}
if (p.Min() == 0)
{
}
x -= p.Min();
return x;
}
}
internal class Program
{
static void Main(string[] args)
{
FileStream fs = new FileStream("fob2016.txt", FileMode.Open, FileAccess.Read);
StreamReader sr = new StreamReader(fs);
List<Jatekos> adatok = new List<Jatekos>();
string sor = sr.ReadLine();
while (sor != null)
{
string[] soradat = sor.Split(';');
int[] temppont = { };
for (int i = 3; i < soradat.Length; i++)
{
int pont = int.Parse(soradat[i]);
temppont = temppont.Append(pont).ToArray();
}
Jatekos jatekos = new Jatekos(soradat[0], soradat[1], soradat[2], temppont);
adatok.Add(jatekos);
sor = sr.ReadLine();
}
double db = 0;
double ndb = 0;
foreach (var item in adatok)
{
db++;
if (item.kategoria == "Noi")
{
ndb++;
}
}
Console.WriteLine($"3. feladat: Versenyzők száma: {db}");
Console.WriteLine($"4. feladat: A női versenyzők aránya: {Math.Round((ndb / db) * 100, 2)}%");
Console.WriteLine($"6. feladat: ");
sr.Close();
fs.Close();
}
}
}

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
</configuration>

@ -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>{C7F30D9D-2317-4ECA-AA55-1DAC7E56D195}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>ConsoleApp1</RootNamespace>
<AssemblyName>ConsoleApp1</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" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.8.34408.163
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp1", "ConsoleApp1.csproj", "{C7F30D9D-2317-4ECA-AA55-1DAC7E56D195}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C7F30D9D-2317-4ECA-AA55-1DAC7E56D195}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C7F30D9D-2317-4ECA-AA55-1DAC7E56D195}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C7F30D9D-2317-4ECA-AA55-1DAC7E56D195}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C7F30D9D-2317-4ECA-AA55-1DAC7E56D195}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C6F3F3CF-D7F5-4056-9FB9-4A361E1918DB}
EndGlobalSection
EndGlobal

@ -0,0 +1,186 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Runtime.InteropServices;
namespace ConsoleApp1
{
public class Jatekos
{
public string nev;
public string kategoria;
public string egyesulet;
public int[] pontok = { };
public int osszpont;
public Jatekos(string Nev, string Kategoria, string Egyesulet, int[] Pontok)
{
nev = Nev;
kategoria = Kategoria;
egyesulet = Egyesulet;
pontok = Pontok;
osszpont = Osszpontszam(Pontok);
}
public static int Osszpontszam(int[] p)
{
int nulldb = 0;
foreach (var item in p)
{
if (item == 0)
{
nulldb++;
}
}
Array.Sort(p);
int x = p.Sum();
int legkisebb = p.Min();
int legkisebb2 = p[1];
if (nulldb == 0)
{
x -= legkisebb;
x -= legkisebb2;
x += 20;
return x;
}
else if (nulldb == 1)
{
x -= legkisebb2;
x += 10;
return x;
}
else
{
return x;
}
}
}
internal class Program
{
static void Main(string[] args)
{
FileStream fs = new FileStream("fob2016.txt", FileMode.Open, FileAccess.Read);
StreamReader sr = new StreamReader(fs);
List<Jatekos> adatok = new List<Jatekos>();
string sor = sr.ReadLine();
while (sor != null)
{
string[] soradat = sor.Split(';');
int[] temppont = { };
for (int i = 3; i < soradat.Length; i++)
{
int pont = int.Parse(soradat[i]);
temppont = temppont.Append(pont).ToArray();
}
Jatekos jatekos = new Jatekos(soradat[0], soradat[1], soradat[2], temppont);
adatok.Add(jatekos);
sor = sr.ReadLine();
}
double db = 0;
double ndb = 0;
foreach (var item in adatok)
{
db++;
if (item.kategoria == "Noi")
{
ndb++;
}
}
Console.WriteLine($"3. feladat: Versenyzők száma: {db}");
Console.WriteLine($"4. feladat: A női versenyzők aránya: {Math.Round((ndb / db) * 100, 2)}%");
int bajnok = 0;
for (int i = 0; i < adatok.Count; i++)
{
if (adatok[i].osszpont > adatok[bajnok].osszpont)
{
bajnok = i;
}
}
Console.WriteLine($"6. feladat: A bajnok női versenyző");
Console.WriteLine($"\tNév: {adatok[bajnok].nev}");
Console.WriteLine($"\tEgyesület: {adatok[bajnok].egyesulet}");
Console.WriteLine($"\tÖsszpont: {adatok[bajnok].osszpont}");
FileStream fileStream = new FileStream("osszpontFF.txt", FileMode.Create, FileAccess.Write); ;
StreamWriter streamWriter = new StreamWriter(fileStream);
foreach (var jatekos in adatok)
{
if (jatekos.kategoria == "Felnott ferfi")
{
streamWriter.WriteLine($"{jatekos.nev};{jatekos.osszpont}");
}
}
streamWriter.Close();
fileStream.Close();
List<string> egy = new List<string>();
List<int> jatekosok = new List<int>();
foreach (var item in adatok)
{
if (egy.Contains(item.egyesulet))
{
continue;
}
else if (item.egyesulet != "n.a.")
{
egy.Add(item.egyesulet);
}
}
foreach (var egyesulet in egy)
{
int cntr = 0;
foreach (var item in adatok)
{
if (egyesulet == item.egyesulet)
{
cntr++;
}
}
jatekosok.Add(cntr);
}
List<int> removeindex = new List<int>();
for (int i = 0; i < egy.Count; i++)
{
if (jatekosok[i] <= 2)
{
removeindex.Add(i);
}
}
Console.WriteLine($"8. feladat: Egyesület statisztika");
removeindex.Reverse();
for (int i = 0; i < removeindex.Count; i++)
{
egy.RemoveAt(removeindex[i]);
jatekosok.RemoveAt(removeindex[i]);
}
for (int i = 0; i < egy.Count; i++)
{
Console.WriteLine($"\t{egy[i]} - {jatekosok[i]} fő");
}
sr.Close();
fs.Close();
}
}
}

@ -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("ConsoleApp1")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ConsoleApp1")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[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("c7f30d9d-2317-4eca-aa55-1dac7e56d195")]
// 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")]

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
</configuration>

@ -0,0 +1,77 @@
Albert Laszlo;Felnott ferfi;HOLE HUNTERS;0;0;10;10;0;0;0;10
Bacskai Bence;Felnott ferfi;HOLE HUNTERS;0;62;110;110;56;95;80;74
Bado Szilard;Felnott ferfi;MTDSC;38;32;26;26;80;11;42;50
Bak Balazs;Felnott ferfi;EMFGSE;10;0;0;0;0;0;0;0
Bako Attila;Felnott ferfi;FTC FOOTGOLF;29;20;10;50;35;0;0;56
Balan Zoltan;Felnott ferfi;FTC FOOTGOLF;10;10;10;46;38;0;0;11
Balanne Szabo Zsuzsa;Noi;FTC FOOTGOLF;0;0;56;56;68;0;0;0
Baranya Akos;Felnott ferfi;TSC HOLE FOR ONE;10;10;10;10;0;10;0;10
Bartal Peter;Felnott ferfi;EMFGSE;10;0;0;0;0;0;0;0
Biro Laszlo;Felnott ferfi;FTC FOOTGOLF;10;11;10;10;17;35;35;20
Bogar Krisztian;Felnott ferfi;FTC FOOTGOLF;50;0;95;68;95;62;46;110
Bolcsfoldi Agnes;Noi;MILAN FOOTGOLF;0;62;62;68;80;0;0;0
Borbely Istvan;Felnott ferfi;EMFGSE;0;0;0;10;10;20;10;10
Cziffra Zoltan;Felnott ferfi;HOLE HUNTERS;14;10;20;14;10;12;32;46
Czirbus Tamas;Felnott ferfi;BFGT;42;29;68;0;10;56;95;80
Dreilinger Nandor;Felnott ferfi;HOLE HUNTERS;17;0;10;10;10;0;0;10
Dusan Vangel;Felnott ferfi;SPARTAK TRNAVA;0;0;0;0;42;0;0;0
Erchegyi Csaba;Felnott ferfi;OUTSIDERS;10;12;10;10;62;42;56;14
Erdelyi Nora;Noi;ROYAL FOOTGOLF CLUB;74;74;80;74;74;80;80;74
Eros Gergely;Felnott ferfi;FTC FOOTGOLF;10;10;10;11;0;10;0;10
Fazekas Gabor;Felnott ferfi;EMFGSE;0;0;10;0;0;0;0;0
Fenyvesi Andras;Felnott ferfi;n.a.;0;0;10;0;0;0;0;0
Flink Janos;Felnott ferfi;OUTSIDERS;26;0;10;10;20;17;50;35
Gelencser Gabor;Felnott ferfi;EMFGSE;74;50;10;95;10;29;74;42
Gyenes Andras;Felnott ferfi;MILAN FOOTGOLF;10;0;10;0;0;0;0;0
Hinora Ferenc;Felnott ferfi;ROYAL FOOTGOLF CLUB;10;10;10;38;29;0;29;26
Hrutka Janos;Felnott ferfi;ROYAL FOOTGOLF CLUB;10;74;29;0;0;0;0;0
Juhasz Zoltan;Felnott ferfi;HAPPY COMPANY;0;0;0;0;0;0;11;0
Juraj Gubani;Felnott ferfi;FG SENEC;0;0;0;0;10;0;0;0
Kalics Jozsef;Felnott ferfi;NIMROD FOOTGOLF EGYESULET;32;0;0;10;0;0;23;0
Kallo Istvan;Felnott ferfi;FTC FOOTGOLF;10;0;62;0;26;0;0;0
Kiss Roland;Felnott ferfi;SZTK FOOTGOLF;10;0;0;0;0;0;0;0
Koszegi Jozsef;Felnott ferfi;FOCICLUB.HU;0;0;0;0;10;0;0;0
Kovacs Andras;Felnott ferfi;EMFGSE;0;42;10;0;0;0;0;0
Kristof Gabor;Felnott ferfi;FTC FOOTGOLF;0;10;10;10;0;0;0;0
Lengyel Bela;Felnott ferfi;FTC FOOTGOLF;68;110;14;80;32;74;62;29
Lenkei Robert;Felnott ferfi;n.a.;0;0;0;10;0;0;0;0
Lovasz Krisztian;Felnott ferfi;n.a.;0;0;0;10;0;0;0;0
Ludovit Andrassy;Felnott ferfi;FG SENEC;0;0;0;0;10;0;0;0
Major Ilona;Noi;FTC FOOTGOLF;110;110;110;110;110;110;110;95
Marek Cechovic;Felnott ferfi;FG SENEC;0;0;17;0;0;0;0;0
Marek Smihel;Felnott ferfi;FG SENEC;0;0;46;0;0;0;0;0
Modroczky Gyorgy;Felnott ferfi;MILAN FOOTGOLF;10;0;10;10;0;0;0;0
Molnar Arnold;Felnott ferfi;MILAN FOOTGOLF;10;23;0;10;0;0;26;10
Molnar Attila;Felnott ferfi;EMFGSE;10;14;10;10;14;23;10;10
Nagy Balazs;Felnott ferfi;HOLE HUNTERS;10;17;11;12;10;50;20;32
Nagy Gabor Milan;Felnott ferfi;MILAN FOOTGOLF;10;0;0;10;0;0;0;0
Nagy Niki;Noi;FTC FOOTGOLF;95;80;95;95;62;0;0;110
Nemeth Ferenc;Felnott ferfi;MTDSC;0;0;0;10;10;0;0;0
Nemeth Gabor;Felnott ferfi;FTC FOOTGOLF;80;95;38;74;74;46;38;68
Nemeth Peter;Felnott ferfi;FTC FOOTGOLF;10;0;23;32;0;0;0;0
Oszi Adam;Felnott ferfi;FOCICLUB.HU;0;0;0;0;10;0;0;0
Pap Ferenc;Felnott ferfi;HOLE HUNTERS;35;10;50;20;10;32;17;62
Papp Peter;Felnott ferfi;BFGT;56;80;56;0;46;68;110;95
Parragh Viktoria;Noi;HOLE FOR ONE;0;68;0;0;0;0;0;0
Poda Tamas;Felnott ferfi;TSC HOLE FOR ONE;10;10;10;0;0;0;0;0
Podusil Gyorgy;Felnott ferfi;BFGT;11;10;80;0;68;80;68;17
Puklus Gabor;Felnott ferfi;NIMROD FOOTGOLF EGYESULET;10;0;0;0;0;0;0;0
Pusztai Panni;Noi;HOLE HUNTERS;80;95;74;80;95;95;95;80
Renata Smihelova;Noi;n.a.;0;0;68;0;0;0;0;0
Richard Nerer;Felnott ferfi;n.a.;0;0;10;0;0;0;0;0
Sain Antal;Felnott ferfi;FTC FOOTGOLF;10;38;10;42;10;0;0;0
Sebestyen Laszlo;Felnott ferfi;EMFGSE;10;10;10;10;10;14;0;10
Simonyi Gabor;Felnott ferfi;OUTSIDERS;110;0;35;56;0;0;0;38
Szabo Laszlo;Felnott ferfi;BFGT;0;0;0;23;11;0;14;0
Szantay Gina;Noi;FTC FOOTGOLF;0;0;0;62;0;0;0;68
Tajtyi Robert;Felnott ferfi;BFGT;62;68;74;0;50;0;0;0
Takacs Attila;Felnott ferfi;EMFGSE;95;35;10;62;23;38;0;10
Tamas Csaba;Felnott ferfi;FOOTGOLF HUNGARY KFT;10;0;10;0;0;10;0;0
Tomas Bartko;Felnott ferfi;FG SENEC;0;0;32;0;110;110;0;0
Tomas Dittinger;Felnott ferfi;FG PETRZALKA;10;0;0;0;0;0;0;0
Tomas Hollosy;Felnott ferfi;FG SENEC;0;0;42;0;0;0;0;0
Tomas Kikus;Felnott ferfi;FG BRATISLAVA;23;0;0;0;0;0;0;0
Torok Tamas;Felnott ferfi;EMFGSE;10;26;10;29;0;0;0;0
Ujszaszi Balazs;Felnott ferfi;ROYAL FOOTGOLF CLUB;10;0;10;17;10;10;10;10
Varga Gabor;Felnott ferfi;ROYAL FOOTGOLF CLUB;20;46;0;0;0;0;0;0
Zsok Richard;Felnott ferfi;ROYAL FOOTGOLF CLUB;46;56;10;35;10;26;0;23

@ -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")]

@ -0,0 +1 @@
25f359d3fd7d560a1dec87ab383b84f91627954af157e6d29c6e8f4a1e97b265

@ -0,0 +1,7 @@
E:\Házi\Programozás\C#\Suli\ProgaOra\20240123\ConsoleApp1\bin\Debug\ConsoleApp1.exe.config
E:\Házi\Programozás\C#\Suli\ProgaOra\20240123\ConsoleApp1\bin\Debug\ConsoleApp1.exe
E:\Házi\Programozás\C#\Suli\ProgaOra\20240123\ConsoleApp1\bin\Debug\ConsoleApp1.pdb
E:\Házi\Programozás\C#\Suli\ProgaOra\20240123\ConsoleApp1\obj\Debug\ConsoleApp1.csproj.AssemblyReference.cache
E:\Házi\Programozás\C#\Suli\ProgaOra\20240123\ConsoleApp1\obj\Debug\ConsoleApp1.csproj.CoreCompileInputs.cache
E:\Házi\Programozás\C#\Suli\ProgaOra\20240123\ConsoleApp1\obj\Debug\ConsoleApp1.exe
E:\Házi\Programozás\C#\Suli\ProgaOra\20240123\ConsoleApp1\obj\Debug\ConsoleApp1.pdb

@ -0,0 +1,68 @@
Albert Laszlo;30
Bacskai Bence;541
Bado Szilard;288
Bak Balazs;10
Bako Attila;200
Balan Zoltan;125
Baranya Akos;60
Bartal Peter;10
Biro Laszlo;148
Bogar Krisztian;490
Borbely Istvan;60
Cziffra Zoltan;158
Czirbus Tamas;380
Dreilinger Nandor;57
Dusan Vangel;42
Erchegyi Csaba;216
Eros Gergely;61
Fazekas Gabor;10
Fenyvesi Andras;10
Flink Janos;168
Gelencser Gabor;384
Gyenes Andras;20
Hinora Ferenc;152
Hrutka Janos;113
Juhasz Zoltan;11
Juraj Gubani;10
Kalics Jozsef;65
Kallo Istvan;98
Kiss Roland;10
Koszegi Jozsef;10
Kovacs Andras;52
Kristof Gabor;30
Lengyel Bela;446
Lenkei Robert;10
Lovasz Krisztian;10
Ludovit Andrassy;10
Marek Cechovic;17
Marek Smihel;46
Modroczky Gyorgy;30
Molnar Arnold;79
Molnar Attila;101
Nagy Balazs;162
Nagy Gabor Milan;20
Nemeth Ferenc;20
Nemeth Gabor;457
Nemeth Peter;65
Oszi Adam;10
Pap Ferenc;236
Papp Peter;475
Poda Tamas;30
Podusil Gyorgy;334
Puklus Gabor;10
Richard Nerer;10
Sain Antal;110
Sebestyen Laszlo;74
Simonyi Gabor;239
Szabo Laszlo;48
Tajtyi Robert;254
Takacs Attila;273
Tamas Csaba;30
Tomas Bartko;252
Tomas Dittinger;10
Tomas Hollosy;42
Tomas Kikus;23
Torok Tamas;75
Ujszaszi Balazs;77
Varga Gabor;66
Zsok Richard;206

Binary file not shown.

@ -0,0 +1,77 @@
Albert Laszlo;Felnott ferfi;HOLE HUNTERS;0;0;10;10;0;0;0;10
Bacskai Bence;Felnott ferfi;HOLE HUNTERS;0;62;110;110;56;95;80;74
Bado Szilard;Felnott ferfi;MTDSC;38;32;26;26;80;11;42;50
Bak Balazs;Felnott ferfi;EMFGSE;10;0;0;0;0;0;0;0
Bako Attila;Felnott ferfi;FTC FOOTGOLF;29;20;10;50;35;0;0;56
Balan Zoltan;Felnott ferfi;FTC FOOTGOLF;10;10;10;46;38;0;0;11
Balanne Szabo Zsuzsa;Noi;FTC FOOTGOLF;0;0;56;56;68;0;0;0
Baranya Akos;Felnott ferfi;TSC HOLE FOR ONE;10;10;10;10;0;10;0;10
Bartal Peter;Felnott ferfi;EMFGSE;10;0;0;0;0;0;0;0
Biro Laszlo;Felnott ferfi;FTC FOOTGOLF;10;11;10;10;17;35;35;20
Bogar Krisztian;Felnott ferfi;FTC FOOTGOLF;50;0;95;68;95;62;46;110
Bolcsfoldi Agnes;Noi;MILAN FOOTGOLF;0;62;62;68;80;0;0;0
Borbely Istvan;Felnott ferfi;EMFGSE;0;0;0;10;10;20;10;10
Cziffra Zoltan;Felnott ferfi;HOLE HUNTERS;14;10;20;14;10;12;32;46
Czirbus Tamas;Felnott ferfi;BFGT;42;29;68;0;10;56;95;80
Dreilinger Nandor;Felnott ferfi;HOLE HUNTERS;17;0;10;10;10;0;0;10
Dusan Vangel;Felnott ferfi;SPARTAK TRNAVA;0;0;0;0;42;0;0;0
Erchegyi Csaba;Felnott ferfi;OUTSIDERS;10;12;10;10;62;42;56;14
Erdelyi Nora;Noi;ROYAL FOOTGOLF CLUB;74;74;80;74;74;80;80;74
Eros Gergely;Felnott ferfi;FTC FOOTGOLF;10;10;10;11;0;10;0;10
Fazekas Gabor;Felnott ferfi;EMFGSE;0;0;10;0;0;0;0;0
Fenyvesi Andras;Felnott ferfi;n.a.;0;0;10;0;0;0;0;0
Flink Janos;Felnott ferfi;OUTSIDERS;26;0;10;10;20;17;50;35
Gelencser Gabor;Felnott ferfi;EMFGSE;74;50;10;95;10;29;74;42
Gyenes Andras;Felnott ferfi;MILAN FOOTGOLF;10;0;10;0;0;0;0;0
Hinora Ferenc;Felnott ferfi;ROYAL FOOTGOLF CLUB;10;10;10;38;29;0;29;26
Hrutka Janos;Felnott ferfi;ROYAL FOOTGOLF CLUB;10;74;29;0;0;0;0;0
Juhasz Zoltan;Felnott ferfi;HAPPY COMPANY;0;0;0;0;0;0;11;0
Juraj Gubani;Felnott ferfi;FG SENEC;0;0;0;0;10;0;0;0
Kalics Jozsef;Felnott ferfi;NIMROD FOOTGOLF EGYESULET;32;0;0;10;0;0;23;0
Kallo Istvan;Felnott ferfi;FTC FOOTGOLF;10;0;62;0;26;0;0;0
Kiss Roland;Felnott ferfi;SZTK FOOTGOLF;10;0;0;0;0;0;0;0
Koszegi Jozsef;Felnott ferfi;FOCICLUB.HU;0;0;0;0;10;0;0;0
Kovacs Andras;Felnott ferfi;EMFGSE;0;42;10;0;0;0;0;0
Kristof Gabor;Felnott ferfi;FTC FOOTGOLF;0;10;10;10;0;0;0;0
Lengyel Bela;Felnott ferfi;FTC FOOTGOLF;68;110;14;80;32;74;62;29
Lenkei Robert;Felnott ferfi;n.a.;0;0;0;10;0;0;0;0
Lovasz Krisztian;Felnott ferfi;n.a.;0;0;0;10;0;0;0;0
Ludovit Andrassy;Felnott ferfi;FG SENEC;0;0;0;0;10;0;0;0
Major Ilona;Noi;FTC FOOTGOLF;110;110;110;110;110;110;110;95
Marek Cechovic;Felnott ferfi;FG SENEC;0;0;17;0;0;0;0;0
Marek Smihel;Felnott ferfi;FG SENEC;0;0;46;0;0;0;0;0
Modroczky Gyorgy;Felnott ferfi;MILAN FOOTGOLF;10;0;10;10;0;0;0;0
Molnar Arnold;Felnott ferfi;MILAN FOOTGOLF;10;23;0;10;0;0;26;10
Molnar Attila;Felnott ferfi;EMFGSE;10;14;10;10;14;23;10;10
Nagy Balazs;Felnott ferfi;HOLE HUNTERS;10;17;11;12;10;50;20;32
Nagy Gabor Milan;Felnott ferfi;MILAN FOOTGOLF;10;0;0;10;0;0;0;0
Nagy Niki;Noi;FTC FOOTGOLF;95;80;95;95;62;0;0;110
Nemeth Ferenc;Felnott ferfi;MTDSC;0;0;0;10;10;0;0;0
Nemeth Gabor;Felnott ferfi;FTC FOOTGOLF;80;95;38;74;74;46;38;68
Nemeth Peter;Felnott ferfi;FTC FOOTGOLF;10;0;23;32;0;0;0;0
Oszi Adam;Felnott ferfi;FOCICLUB.HU;0;0;0;0;10;0;0;0
Pap Ferenc;Felnott ferfi;HOLE HUNTERS;35;10;50;20;10;32;17;62
Papp Peter;Felnott ferfi;BFGT;56;80;56;0;46;68;110;95
Parragh Viktoria;Noi;HOLE FOR ONE;0;68;0;0;0;0;0;0
Poda Tamas;Felnott ferfi;TSC HOLE FOR ONE;10;10;10;0;0;0;0;0
Podusil Gyorgy;Felnott ferfi;BFGT;11;10;80;0;68;80;68;17
Puklus Gabor;Felnott ferfi;NIMROD FOOTGOLF EGYESULET;10;0;0;0;0;0;0;0
Pusztai Panni;Noi;HOLE HUNTERS;80;95;74;80;95;95;95;80
Renata Smihelova;Noi;n.a.;0;0;68;0;0;0;0;0
Richard Nerer;Felnott ferfi;n.a.;0;0;10;0;0;0;0;0
Sain Antal;Felnott ferfi;FTC FOOTGOLF;10;38;10;42;10;0;0;0
Sebestyen Laszlo;Felnott ferfi;EMFGSE;10;10;10;10;10;14;0;10
Simonyi Gabor;Felnott ferfi;OUTSIDERS;110;0;35;56;0;0;0;38
Szabo Laszlo;Felnott ferfi;BFGT;0;0;0;23;11;0;14;0
Szantay Gina;Noi;FTC FOOTGOLF;0;0;0;62;0;0;0;68
Tajtyi Robert;Felnott ferfi;BFGT;62;68;74;0;50;0;0;0
Takacs Attila;Felnott ferfi;EMFGSE;95;35;10;62;23;38;0;10
Tamas Csaba;Felnott ferfi;FOOTGOLF HUNGARY KFT;10;0;10;0;0;10;0;0
Tomas Bartko;Felnott ferfi;FG SENEC;0;0;32;0;110;110;0;0
Tomas Dittinger;Felnott ferfi;FG PETRZALKA;10;0;0;0;0;0;0;0
Tomas Hollosy;Felnott ferfi;FG SENEC;0;0;42;0;0;0;0;0
Tomas Kikus;Felnott ferfi;FG BRATISLAVA;23;0;0;0;0;0;0;0
Torok Tamas;Felnott ferfi;EMFGSE;10;26;10;29;0;0;0;0
Ujszaszi Balazs;Felnott ferfi;ROYAL FOOTGOLF CLUB;10;0;10;17;10;10;10;10
Varga Gabor;Felnott ferfi;ROYAL FOOTGOLF CLUB;20;46;0;0;0;0;0;0
Zsok Richard;Felnott ferfi;ROYAL FOOTGOLF CLUB;46;56;10;35;10;26;0;23

@ -0,0 +1,153 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace footgolf
{
class fobDatabase
{
public string versenyzoNeve { get; set;}
public string versenyzoKategoriaja { get; set; }
public string versenyzoEgyesuletNeve { get; set; }
public int[] versenyzoPontjai = { };
public fobDatabase(string line)
{
string[] splittedLine = line.Split(';');
this.versenyzoNeve = splittedLine[0];
this.versenyzoKategoriaja = splittedLine[1];
this.versenyzoEgyesuletNeve = splittedLine[2];
for (int i = 3; i < splittedLine.Length; i++)
{
versenyzoPontjai = versenyzoPontjai.Append(int.Parse(splittedLine[i])).ToArray();
}
}
public int [] valogatottLista = { };
public int pontSumma = 0;
public void pontSzamitas(int [] lista)
{
Array.Sort(lista);
for (int i = 0; i < lista.Length; i++)
{
if (lista[0] != 0)
{
Console.WriteLine(pontSumma);
pontSumma += 10;
Console.WriteLine(pontSumma);
}
else if(lista[1] != 0)
{
Console.WriteLine(pontSumma);
pontSumma += 10;
Console.WriteLine(pontSumma);
}
}
for (int i = 2; i < lista.Length; i++)
{
valogatottLista = valogatottLista.Append(lista[i]).ToArray();
}
for (int i = 0; i < valogatottLista.Length; i++)
{
pontSumma += valogatottLista[i];
}
/*for (int i = 0; i < valogatottLista.Length; i++)
{
Console.Write($"{valogatottLista[i]}, ");
}*/
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
namespace footgolf
{
class Program
{
static void Main(string[] args)
{
//2. feladat
string[] sorok = File.ReadAllLines("C:\\Users\\medvegergo\\Desktop\\fob2016.txt");
List<fobDatabase> db = new List<fobDatabase>();
for (int i = 0; i < sorok.Length; i++)
{
fobDatabase bemenet = new fobDatabase(sorok[i]);
db.Add(bemenet);
}
//3. feladat
Console.WriteLine($"3. feladat: Versenyzők száma: {db.Count}");
//4. feladat
double nokSzama = 0;
for (int i = 0; i < db.Count; i++)
{
if (db[i].versenyzoKategoriaja == "Noi")
{
nokSzama++;
}
}
Console.WriteLine($"4. feladat: A női versenyzők aránya: {Math.Round((nokSzama / db.Count) * 100, 2)}");
//5. feladat
for (int i = 0; i < db.Count; i++)
{
int[] bemenetiLista = db[i].versenyzoPontjai;
db[i].pontSzamitas(bemenetiLista);
}
//6. feladat
Console.WriteLine("6. feladat: A bajnok női versenyző");
int index = 0;
int legnagyobbPont = 0;
for (int i = 0; i < db.Count; i++)
{
if (db[i].pontSumma > legnagyobbPont)
{
legnagyobbPont = db[i].pontSumma;
index = i;
}
}
Console.WriteLine($"Név: {db[index].versenyzoNeve}");
Console.WriteLine($"Egyesület: {db[index].versenyzoEgyesuletNeve}");
Console.WriteLine($"Összpont: {db[index].pontSumma}");
//7. feladat
string[] irandoSorok = { };
for (int i = 0; i < db.Count; i++)
{
if(db[i].versenyzoKategoriaja == "Felnott ferfi")
{
string irandoSor = $"{db[i].versenyzoNeve};{db[i].pontSumma}";
irandoSorok = irandoSorok.Append(irandoSor).ToArray();
}
}
File.WriteAllLines("C:\\Users\\medvegergo\\Desktop\\osszpontFF.txt", irandoSorok);
Console.WriteLine();
/*for (int i = 0; i < db.Count; i++)
{
Console.WriteLine(db[i].versenyzoNeve);
}*/
Console.ReadKey();
}
}
}
Loading…
Cancel
Save