fixed stopwatch
This commit is contained in:
parent
b6df6a1a66
commit
a6d8fda3ac
117
20240122
117
20240122
|
@ -1,117 +0,0 @@
|
|||
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();
|
||||
}
|
||||
}
|
||||
}
|
Binary file not shown.
BIN
20240311/WindowsFormsApp1/.vs/WindowsFormsApp1/v17/.suo
Normal file
BIN
20240311/WindowsFormsApp1/.vs/WindowsFormsApp1/v17/.suo
Normal file
Binary file not shown.
2
20240311/WindowsFormsApp1/Form1.Designer.cs
generated
2
20240311/WindowsFormsApp1/Form1.Designer.cs
generated
|
@ -98,7 +98,7 @@ namespace WindowsFormsApp1
|
|||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(161, 190);
|
||||
this.label2.Location = new System.Drawing.Point(128, 190);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(0, 13);
|
||||
this.label2.TabIndex = 5;
|
||||
|
|
|
@ -10,10 +10,6 @@ using System.Windows.Forms;
|
|||
|
||||
namespace WindowsFormsApp1
|
||||
{
|
||||
public static class Data
|
||||
{
|
||||
public static List<TimeSpan> idok = new List<TimeSpan>();
|
||||
}
|
||||
public partial class Form1 : Form
|
||||
{
|
||||
DateTime start = new DateTime();
|
||||
|
@ -43,22 +39,21 @@ namespace WindowsFormsApp1
|
|||
{
|
||||
stop = DateTime.Now;
|
||||
duration = stop - start;
|
||||
label1.Text = duration.ToString();
|
||||
|
||||
|
||||
timer1.Enabled = false;
|
||||
button1.Enabled = true;
|
||||
|
||||
timer2.Stop();
|
||||
|
||||
Data.idok.Append(currSpan);
|
||||
|
||||
//Data.lasttime = currSpan.ToString();
|
||||
Data.data.Add(currSpan.ToString());
|
||||
label2.Text = "";
|
||||
|
||||
foreach (var item in Data.idok)
|
||||
foreach (var item in Data.data)
|
||||
{
|
||||
string asd = item.ToString();
|
||||
label2.Text = label2.Text + asd;
|
||||
label2.Text += $"{item}\n";
|
||||
}
|
||||
//label2.Text = Data.lasttime;
|
||||
}
|
||||
|
||||
private void label1_Click(object sender, EventArgs e)
|
||||
|
@ -94,5 +89,12 @@ namespace WindowsFormsApp1
|
|||
{
|
||||
|
||||
}
|
||||
|
||||
public static class Data
|
||||
{
|
||||
public static string lasttime = "";
|
||||
|
||||
public static List<string> data = new List<string>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1 +1 @@
|
|||
8069502011d0681850e57a53d5a1673222f430a6
|
||||
ffeb981a72357c13c78580d1de8dfcfdeab69b3831ebd504970e578b1a834c6f
|
||||
|
|
|
@ -18,3 +18,13 @@ C:\Users\szabomarton\Desktop\C#\ProgaOra\20240311\WindowsFormsApp1\obj\Debug\Win
|
|||
C:\Users\szabomarton\Desktop\C#\ProgaOra\20240311\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.exe
|
||||
C:\Users\szabomarton\Desktop\C#\ProgaOra\20240311\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.pdb
|
||||
C:\Users\szabomarton\Desktop\C#\ProgaOra\20240311\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.Data.resources
|
||||
E:\Házi\Programozás\C#\Suli\ProgaOra\20240311\WindowsFormsApp1\bin\Debug\WindowsFormsApp1.exe.config
|
||||
E:\Házi\Programozás\C#\Suli\ProgaOra\20240311\WindowsFormsApp1\bin\Debug\WindowsFormsApp1.exe
|
||||
E:\Házi\Programozás\C#\Suli\ProgaOra\20240311\WindowsFormsApp1\bin\Debug\WindowsFormsApp1.pdb
|
||||
E:\Házi\Programozás\C#\Suli\ProgaOra\20240311\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.csproj.AssemblyReference.cache
|
||||
E:\Házi\Programozás\C#\Suli\ProgaOra\20240311\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.Form1.resources
|
||||
E:\Házi\Programozás\C#\Suli\ProgaOra\20240311\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.Properties.Resources.resources
|
||||
E:\Házi\Programozás\C#\Suli\ProgaOra\20240311\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.csproj.GenerateResource.cache
|
||||
E:\Házi\Programozás\C#\Suli\ProgaOra\20240311\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.csproj.CoreCompileInputs.cache
|
||||
E:\Házi\Programozás\C#\Suli\ProgaOra\20240311\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.exe
|
||||
E:\Házi\Programozás\C#\Suli\ProgaOra\20240311\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.pdb
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user