Add project files.
This commit is contained in:
57
KiMitTud/Program.cs
Normal file
57
KiMitTud/Program.cs
Normal file
@@ -0,0 +1,57 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.IO;
|
||||
|
||||
namespace KiMitTud
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
|
||||
List<Versenyzo> Versenyzolista = new List<Versenyzo>();
|
||||
|
||||
|
||||
string[] nyers = File.ReadAllLines(@"..\..\selejtezo.txt");
|
||||
foreach (var item in nyers)
|
||||
{
|
||||
Versenyzolista.Add(new Versenyzo(item));
|
||||
}
|
||||
|
||||
Console.WriteLine($"3. feladat : a versenyen {Versenyzolista.Count} Versenyző vett részt");
|
||||
|
||||
|
||||
|
||||
Console.WriteLine("4. Feladat Kérem a Kritikus számát");
|
||||
int valasztottkritikus = int.Parse(Console.ReadLine());
|
||||
|
||||
double Osszeadva = 0;
|
||||
|
||||
foreach (var item in Versenyzolista)
|
||||
{
|
||||
Osszeadva += item.pontoklista[valasztottkritikus - 1] ;
|
||||
|
||||
}
|
||||
|
||||
Console.WriteLine($"5. Feladat: A választott kritikus pontszámainak átlaga: {(Osszeadva/6):N1}");
|
||||
|
||||
string Legnagyobbpontszamos = Versenyzolista[0].nev;
|
||||
int legnagyobbpontszam = Versenyzolista[0].elertpontok;
|
||||
foreach (var item in Versenyzolista)
|
||||
{
|
||||
if (item.elertpontok > legnagyobbpontszam)
|
||||
{
|
||||
legnagyobbpontszam = item.elertpontok;
|
||||
Legnagyobbpontszamos = item.nev;
|
||||
}
|
||||
}
|
||||
|
||||
Console.WriteLine($"6. Feladat : A legnagyobb pontszámmal rendelkező személy : {Legnagyobbpontszamos} {legnagyobbpontszam} ponttal.");
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user