TODO 2 e
This commit is contained in:
parent
9be4cba137
commit
9969d17bcc
fordulo_2/Program
.vs/Program
CopilotIndices/17.13.431.34963
FileContentIndex
10306f20-1903-4ad6-83dd-f8e302ec3180.vsidx6893f8c3-8ee9-4562-aeb0-3800d3539bee.vsidxc3d66a48-e0b6-40c3-bbec-fa0b7a0d8129.vsidxe06ac909-7382-4c50-8c8f-de899b80d8ab.vsidx
copilot-chat/f9c248b7/sessions
v17
bin/Debug
obj/Debug
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -9,10 +9,6 @@
|
||||||
{
|
{
|
||||||
"AbsoluteMoniker": "D:0:0:{41CA5E6D-695E-47A8-9C50-9B4BFF31D3A5}|Program.csproj|E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_2\\Program\\jatekos.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
"AbsoluteMoniker": "D:0:0:{41CA5E6D-695E-47A8-9C50-9B4BFF31D3A5}|Program.csproj|E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_2\\Program\\jatekos.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||||
"RelativeMoniker": "D:0:0:{41CA5E6D-695E-47A8-9C50-9B4BFF31D3A5}|Program.csproj|solutionrelative:jatekos.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
"RelativeMoniker": "D:0:0:{41CA5E6D-695E-47A8-9C50-9B4BFF31D3A5}|Program.csproj|solutionrelative:jatekos.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||||
},
|
|
||||||
{
|
|
||||||
"AbsoluteMoniker": "D:0:0:{41CA5E6D-695E-47A8-9C50-9B4BFF31D3A5}|Program.csproj|E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_2\\Program\\idopont.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
|
||||||
"RelativeMoniker": "D:0:0:{41CA5E6D-695E-47A8-9C50-9B4BFF31D3A5}|Program.csproj|solutionrelative:idopont.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"DocumentGroupContainers": [
|
"DocumentGroupContainers": [
|
||||||
|
@ -22,7 +18,7 @@
|
||||||
"DocumentGroups": [
|
"DocumentGroups": [
|
||||||
{
|
{
|
||||||
"DockedWidth": 200,
|
"DockedWidth": 200,
|
||||||
"SelectedChildIndex": 2,
|
"SelectedChildIndex": 1,
|
||||||
"Children": [
|
"Children": [
|
||||||
{
|
{
|
||||||
"$type": "Document",
|
"$type": "Document",
|
||||||
|
@ -32,24 +28,11 @@
|
||||||
"RelativeDocumentMoniker": "Jatekos.cs",
|
"RelativeDocumentMoniker": "Jatekos.cs",
|
||||||
"ToolTip": "E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_2\\Program\\Jatekos.cs",
|
"ToolTip": "E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_2\\Program\\Jatekos.cs",
|
||||||
"RelativeToolTip": "Jatekos.cs",
|
"RelativeToolTip": "Jatekos.cs",
|
||||||
"ViewState": "AgIAAAEAAAAAAAAAAAAiwBQAAAAAAAAAAAAAAA==",
|
"ViewState": "AgIAAAQAAAAAAAAAAAAiwCcAAAAvAAAAAAAAAA==",
|
||||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||||
"WhenOpened": "2025-03-05T17:40:39.379Z",
|
"WhenOpened": "2025-03-05T17:40:39.379Z",
|
||||||
"EditorCaption": ""
|
"EditorCaption": ""
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"$type": "Document",
|
|
||||||
"DocumentIndex": 2,
|
|
||||||
"Title": "Idopont.cs",
|
|
||||||
"DocumentMoniker": "E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_2\\Program\\Idopont.cs",
|
|
||||||
"RelativeDocumentMoniker": "Idopont.cs",
|
|
||||||
"ToolTip": "E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_2\\Program\\Idopont.cs",
|
|
||||||
"RelativeToolTip": "Idopont.cs",
|
|
||||||
"ViewState": "AgIAAAIAAAAAAAAAAAAAwC4AAAAJAAAAAAAAAA==",
|
|
||||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
|
||||||
"WhenOpened": "2025-03-05T11:46:26.985Z",
|
|
||||||
"EditorCaption": ""
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"$type": "Document",
|
"$type": "Document",
|
||||||
"DocumentIndex": 0,
|
"DocumentIndex": 0,
|
||||||
|
@ -58,7 +41,7 @@
|
||||||
"RelativeDocumentMoniker": "Program.cs",
|
"RelativeDocumentMoniker": "Program.cs",
|
||||||
"ToolTip": "E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_2\\Program\\Program.cs",
|
"ToolTip": "E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_2\\Program\\Program.cs",
|
||||||
"RelativeToolTip": "Program.cs",
|
"RelativeToolTip": "Program.cs",
|
||||||
"ViewState": "AgIAADoAAAAAAAAAAAAAAGgAAAAAAAAAAAAAAA==",
|
"ViewState": "AgIAAM8AAAAAAAAAAAAAAOcAAABHAAAAAAAAAA==",
|
||||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||||
"WhenOpened": "2025-03-05T11:40:10.358Z",
|
"WhenOpened": "2025-03-05T11:40:10.358Z",
|
||||||
"EditorCaption": ""
|
"EditorCaption": ""
|
||||||
|
|
|
@ -6,10 +6,6 @@
|
||||||
"AbsoluteMoniker": "D:0:0:{41CA5E6D-695E-47A8-9C50-9B4BFF31D3A5}|Program.csproj|e:\\h\u00E1zi\\13.oszt\u00E1ly\\neumann_verseny\\fordulo_2\\program\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
"AbsoluteMoniker": "D:0:0:{41CA5E6D-695E-47A8-9C50-9B4BFF31D3A5}|Program.csproj|e:\\h\u00E1zi\\13.oszt\u00E1ly\\neumann_verseny\\fordulo_2\\program\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||||
"RelativeMoniker": "D:0:0:{41CA5E6D-695E-47A8-9C50-9B4BFF31D3A5}|Program.csproj|solutionrelative:program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
"RelativeMoniker": "D:0:0:{41CA5E6D-695E-47A8-9C50-9B4BFF31D3A5}|Program.csproj|solutionrelative:program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"AbsoluteMoniker": "D:0:0:{41CA5E6D-695E-47A8-9C50-9B4BFF31D3A5}|Program.csproj|E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_2\\Program\\idopont.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
|
||||||
"RelativeMoniker": "D:0:0:{41CA5E6D-695E-47A8-9C50-9B4BFF31D3A5}|Program.csproj|solutionrelative:idopont.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"AbsoluteMoniker": "D:0:0:{41CA5E6D-695E-47A8-9C50-9B4BFF31D3A5}|Program.csproj|E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_2\\Program\\jatekos.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
"AbsoluteMoniker": "D:0:0:{41CA5E6D-695E-47A8-9C50-9B4BFF31D3A5}|Program.csproj|E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_2\\Program\\jatekos.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
|
||||||
"RelativeMoniker": "D:0:0:{41CA5E6D-695E-47A8-9C50-9B4BFF31D3A5}|Program.csproj|solutionrelative:jatekos.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
"RelativeMoniker": "D:0:0:{41CA5E6D-695E-47A8-9C50-9B4BFF31D3A5}|Program.csproj|solutionrelative:jatekos.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||||
|
@ -22,34 +18,21 @@
|
||||||
"DocumentGroups": [
|
"DocumentGroups": [
|
||||||
{
|
{
|
||||||
"DockedWidth": 200,
|
"DockedWidth": 200,
|
||||||
"SelectedChildIndex": 2,
|
"SelectedChildIndex": 1,
|
||||||
"Children": [
|
"Children": [
|
||||||
{
|
{
|
||||||
"$type": "Document",
|
"$type": "Document",
|
||||||
"DocumentIndex": 2,
|
"DocumentIndex": 1,
|
||||||
"Title": "Jatekos.cs",
|
"Title": "Jatekos.cs",
|
||||||
"DocumentMoniker": "E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_2\\Program\\Jatekos.cs",
|
"DocumentMoniker": "E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_2\\Program\\Jatekos.cs",
|
||||||
"RelativeDocumentMoniker": "Jatekos.cs",
|
"RelativeDocumentMoniker": "Jatekos.cs",
|
||||||
"ToolTip": "E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_2\\Program\\Jatekos.cs",
|
"ToolTip": "E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_2\\Program\\Jatekos.cs",
|
||||||
"RelativeToolTip": "Jatekos.cs",
|
"RelativeToolTip": "Jatekos.cs",
|
||||||
"ViewState": "AgIAAAEAAAAAAAAAAAAiwBQAAAAAAAAAAAAAAA==",
|
"ViewState": "AgIAAAQAAAAAAAAAAAAiwCcAAAAvAAAAAAAAAA==",
|
||||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||||
"WhenOpened": "2025-03-05T17:40:39.379Z",
|
"WhenOpened": "2025-03-05T17:40:39.379Z",
|
||||||
"EditorCaption": ""
|
"EditorCaption": ""
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"$type": "Document",
|
|
||||||
"DocumentIndex": 1,
|
|
||||||
"Title": "Idopont.cs",
|
|
||||||
"DocumentMoniker": "E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_2\\Program\\Idopont.cs",
|
|
||||||
"RelativeDocumentMoniker": "Idopont.cs",
|
|
||||||
"ToolTip": "E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_2\\Program\\Idopont.cs",
|
|
||||||
"RelativeToolTip": "Idopont.cs",
|
|
||||||
"ViewState": "AgIAAAgAAAAAAAAAAAAAwC4AAAAJAAAAAAAAAA==",
|
|
||||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
|
||||||
"WhenOpened": "2025-03-05T11:46:26.985Z",
|
|
||||||
"EditorCaption": ""
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"$type": "Document",
|
"$type": "Document",
|
||||||
"DocumentIndex": 0,
|
"DocumentIndex": 0,
|
||||||
|
@ -58,7 +41,7 @@
|
||||||
"RelativeDocumentMoniker": "Program.cs",
|
"RelativeDocumentMoniker": "Program.cs",
|
||||||
"ToolTip": "E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_2\\Program\\Program.cs",
|
"ToolTip": "E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_2\\Program\\Program.cs",
|
||||||
"RelativeToolTip": "Program.cs",
|
"RelativeToolTip": "Program.cs",
|
||||||
"ViewState": "AgIAAEMAAAAAAAAAAAAAAGkAAAANAAAAAAAAAA==",
|
"ViewState": "AgIAAOoAAAAAAAAAAADwv/UAAAAQAAAAAAAAAA==",
|
||||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||||
"WhenOpened": "2025-03-05T11:40:10.358Z",
|
"WhenOpened": "2025-03-05T11:40:10.358Z",
|
||||||
"EditorCaption": ""
|
"EditorCaption": ""
|
||||||
|
|
|
@ -10,7 +10,24 @@ namespace Program
|
||||||
{
|
{
|
||||||
public string Nev { get; set; }
|
public string Nev { get; set; }
|
||||||
|
|
||||||
public int Pontszam { get; set; }
|
|
||||||
|
public Minta Minta = new Minta();
|
||||||
|
}
|
||||||
|
|
||||||
|
class Minta
|
||||||
|
{
|
||||||
|
public bool Nagysor { get; set; }
|
||||||
|
public bool Kissor { get; set; }
|
||||||
|
public bool Poker { get; set; }
|
||||||
|
public bool Full { get; set; }
|
||||||
|
public bool Terc { get; set; }
|
||||||
|
public bool KetPar { get; set; }
|
||||||
|
public bool EgyPar { get; set; }
|
||||||
|
|
||||||
|
public bool AllTrue()
|
||||||
|
{
|
||||||
|
return Nagysor && Kissor && Poker && Full && Terc && KetPar && EgyPar;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Kor
|
class Kor
|
||||||
|
@ -18,5 +35,8 @@ namespace Program
|
||||||
public Jatekos jatekos { get; set; }
|
public Jatekos jatekos { get; set; }
|
||||||
|
|
||||||
public int[] dobasok { get; set; }
|
public int[] dobasok { get; set; }
|
||||||
|
|
||||||
|
public int[] dobasokFull { get; set; }
|
||||||
|
public int[] dontesekFull { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,10 @@ namespace Program
|
||||||
var dobasok = new List<int>();
|
var dobasok = new List<int>();
|
||||||
var dontesek = new List<int>();
|
var dontesek = new List<int>();
|
||||||
|
|
||||||
|
//d feladathoz
|
||||||
|
int pokermaxNum = 0;
|
||||||
|
|
||||||
|
|
||||||
//dobasok
|
//dobasok
|
||||||
|
|
||||||
var data = File.ReadAllText(path).Trim();
|
var data = File.ReadAllText(path).Trim();
|
||||||
|
@ -63,11 +67,17 @@ namespace Program
|
||||||
|
|
||||||
int jatekosCounter = 0;
|
int jatekosCounter = 0;
|
||||||
|
|
||||||
|
List<int> dobasokFull = new List<int>();
|
||||||
|
List<int> dontesekFull = new List<int>();
|
||||||
|
|
||||||
for (int i = 0; i < dobasok.Count; i++)
|
for (int i = 0; i < dobasok.Count; i++)
|
||||||
{
|
{
|
||||||
int dobas = dobasok[i];
|
int dobas = dobasok[i];
|
||||||
int dontes = dontesek[i];
|
int dontes = dontesek[i];
|
||||||
|
|
||||||
|
dobasokFull.Add(dobas);
|
||||||
|
dontesekFull.Add(dontes);
|
||||||
|
|
||||||
if (dontes == 1)
|
if (dontes == 1)
|
||||||
{
|
{
|
||||||
dobasokSmallerScope.Add(dobas);
|
dobasokSmallerScope.Add(dobas);
|
||||||
|
@ -78,6 +88,12 @@ namespace Program
|
||||||
kor.dobasok = dobasokSmallerScope.ToArray();
|
kor.dobasok = dobasokSmallerScope.ToArray();
|
||||||
kor.jatekos = jatekosok[jatekosCounter];
|
kor.jatekos = jatekosok[jatekosCounter];
|
||||||
|
|
||||||
|
kor.dobasokFull = dobasokFull.ToArray();
|
||||||
|
kor.dontesekFull = dontesekFull.ToArray();
|
||||||
|
|
||||||
|
dobasokFull.Clear();
|
||||||
|
dontesekFull.Clear();
|
||||||
|
|
||||||
korok.Add(kor);
|
korok.Add(kor);
|
||||||
|
|
||||||
dobasokSmallerScope.Clear();
|
dobasokSmallerScope.Clear();
|
||||||
|
@ -89,7 +105,7 @@ namespace Program
|
||||||
{
|
{
|
||||||
jatekosCounter++;
|
jatekosCounter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -100,11 +116,176 @@ namespace Program
|
||||||
Console.WriteLine($"Teljes körök száma: {korok.Count / 3}");
|
Console.WriteLine($"Teljes körök száma: {korok.Count / 3}");
|
||||||
|
|
||||||
// b feladat
|
// b feladat
|
||||||
foreach (var item in korok)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
foreach (var kor in korok)
|
||||||
|
{
|
||||||
|
foreach (var jatekos in jatekosok)
|
||||||
|
{
|
||||||
|
if (jatekos.Nev == kor.jatekos.Nev)
|
||||||
|
{
|
||||||
|
int[] dobasokAKorben = kor.dobasok;
|
||||||
|
|
||||||
|
bool sorCondition = dobasokAKorben.Distinct().Count() == 5;
|
||||||
|
|
||||||
|
//nagysor
|
||||||
|
if (sorCondition && dobasokAKorben.Contains(6))
|
||||||
|
{
|
||||||
|
jatekos.Minta.Nagysor = true;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
//kissor
|
||||||
|
if (sorCondition && dobasokAKorben.Contains(1))
|
||||||
|
{
|
||||||
|
jatekos.Minta.Kissor = true;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
//poker
|
||||||
|
var pokerGroup = dobasokAKorben.GroupBy(x => x).FirstOrDefault(g => g.Count() == 4);
|
||||||
|
if (pokerGroup != null)
|
||||||
|
{
|
||||||
|
int pokerValue = pokerGroup.Key;
|
||||||
|
if (pokerValue > pokermaxNum)
|
||||||
|
{
|
||||||
|
pokermaxNum = pokerValue;
|
||||||
|
}
|
||||||
|
jatekos.Minta.Poker = true;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
//full
|
||||||
|
if (dobasokAKorben.Count(x => x == 3) == 1 && dobasokAKorben.Count(x => x == 2) == 1)
|
||||||
|
{
|
||||||
|
jatekos.Minta.Full = true;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
//terc
|
||||||
|
if (dobasokAKorben.Count(x => x == 3) == 1)
|
||||||
|
{
|
||||||
|
jatekos.Minta.Terc = true;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
//ketpar
|
||||||
|
if (dobasokAKorben.Count(x => x == 2) == 2)
|
||||||
|
{
|
||||||
|
jatekos.Minta.KetPar = true;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
//egypar
|
||||||
|
if (dobasokAKorben.Count(x => x == 2) == 1)
|
||||||
|
{
|
||||||
|
jatekos.Minta.EgyPar = true;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (var jatekos in jatekosok)
|
||||||
|
{
|
||||||
|
if (jatekos.Minta.AllTrue())
|
||||||
|
{
|
||||||
|
Console.WriteLine($"{jatekos.Nev} nyerte meg a játékot");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// c feladat
|
||||||
|
|
||||||
|
int counter = 0;
|
||||||
|
|
||||||
|
foreach (var kor in korok)
|
||||||
|
{
|
||||||
|
if (kor.jatekos.Nev == "Gamma")
|
||||||
|
{
|
||||||
|
int[] dobasokAKorben = kor.dobasok;
|
||||||
|
counter++;
|
||||||
|
if (dobasokAKorben.Count(x => x == 3) == 1 && dobasokAKorben.Count(x => x == 2) == 1)
|
||||||
|
{
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Console.WriteLine($"Gamma ebbe a körbe dobott full-t: {counter + 1}");
|
||||||
|
|
||||||
|
// d feladat
|
||||||
|
|
||||||
|
Console.WriteLine($"A legnagyobb poker értéke: {pokermaxNum}");
|
||||||
|
|
||||||
|
|
||||||
|
// e feladat
|
||||||
|
foreach (var kor in korok)
|
||||||
|
{
|
||||||
|
IntArrKiir(kor.dobasokFull);
|
||||||
|
IntArrKiir(kor.dontesekFull);
|
||||||
|
Console.WriteLine("---------");
|
||||||
|
}
|
||||||
|
|
||||||
|
Console.WriteLine(CountPairs(new int[] { 2, 2, 3, 3, 4 }));
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static int GetAllPairs(List<int> dobasok, List<int> dontesek)
|
||||||
|
{
|
||||||
|
int pairs = 0;
|
||||||
|
|
||||||
|
List<int> asztalok = new List<int>();
|
||||||
|
|
||||||
|
foreach (var dobas in dobasok)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return pairs;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int CountPairs(int[] dobasok)
|
||||||
|
{
|
||||||
|
int pairs = 0;
|
||||||
|
|
||||||
|
//terc
|
||||||
|
if (dobasok.Count(x => x == 3) == 1)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
var pokerGroup = dobasok.GroupBy(x => x).FirstOrDefault(g => g.Count() == 4);
|
||||||
|
if (pokerGroup != null)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
for (int i = 0; i < dobasok.Length; i++)
|
||||||
|
{
|
||||||
|
for (int j = i + 1; j < dobasok.Length; j++)
|
||||||
|
{
|
||||||
|
if (dobasok[i] == dobasok[j])
|
||||||
|
{
|
||||||
|
pairs++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return pairs;
|
||||||
|
}
|
||||||
|
static void IntArrKiir(int[] arr)
|
||||||
|
{
|
||||||
|
foreach (var item in arr)
|
||||||
|
{
|
||||||
|
Console.Write(item + " ");
|
||||||
|
}
|
||||||
|
Console.WriteLine();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Feladat1()
|
static void Feladat1()
|
||||||
|
@ -169,25 +350,26 @@ namespace Program
|
||||||
|
|
||||||
int counter = 0;
|
int counter = 0;
|
||||||
int iterations = 0;
|
int iterations = 0;
|
||||||
int napokCounter = 0;
|
int napokCounter = 1;
|
||||||
|
|
||||||
foreach (var item in idopontok2)
|
foreach (var item in idopontok2)
|
||||||
{
|
{
|
||||||
if (counter == anglesToLookFor.Count)
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (item.Angle == anglesToLookFor[counter])
|
if (item.Angle == anglesToLookFor[counter])
|
||||||
{
|
{
|
||||||
counter++;
|
counter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (counter == anglesToLookFor.Count)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
iterations++;
|
iterations++;
|
||||||
|
|
||||||
if (iterations == 1440)
|
if (iterations == 1440)
|
||||||
{
|
{
|
||||||
napokCounter++;
|
napokCounter++;
|
||||||
|
iterations = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
14
gamma
Normal file
14
gamma
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
6 6 2 5 4
|
||||||
|
4 4 4 3 4
|
||||||
|
6 1 1 6 4
|
||||||
|
3 3 4 2 5
|
||||||
|
4 4 4 2 3
|
||||||
|
4 4 6 6 6
|
||||||
|
6 3 2 4 1
|
||||||
|
4 1 2 5 5
|
||||||
|
4 5 1 2 1
|
||||||
|
2 5 6 3 6
|
||||||
|
2 4 1 5 2
|
||||||
|
3 4 1 2 1
|
||||||
|
1 2 3 5 3
|
||||||
|
1 5 3 4 6
|
|
@ -23,12 +23,12 @@
|
||||||
### 1. feladat
|
### 1. feladat
|
||||||
- a: `3:49`
|
- a: `3:49`
|
||||||
- b: `1.5`
|
- b: `1.5`
|
||||||
- c: `1|15:37`
|
- c: `4|15:36`
|
||||||
|
|
||||||
### 2. feladat
|
### 2. feladat
|
||||||
- a: `14`
|
- a: `14`
|
||||||
- b: ``
|
- b: `alfa`
|
||||||
- c: ``
|
- c: `1`
|
||||||
- d: ``
|
- d: ``
|
||||||
- e: ``
|
- e: ``
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user