added sol for 2 a
This commit is contained in:
parent
ca49bc92c7
commit
9be4cba137
fordulo_2/Program
megoldasok.md
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -7,7 +7,7 @@
|
||||||
"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\\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}"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -47,7 +47,8 @@
|
||||||
"RelativeToolTip": "Idopont.cs",
|
"RelativeToolTip": "Idopont.cs",
|
||||||
"ViewState": "AgIAAAIAAAAAAAAAAAAAwC4AAAAJAAAAAAAAAA==",
|
"ViewState": "AgIAAAIAAAAAAAAAAAAAwC4AAAAJAAAAAAAAAA==",
|
||||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||||
"WhenOpened": "2025-03-05T11:46:26.985Z"
|
"WhenOpened": "2025-03-05T11:46:26.985Z",
|
||||||
|
"EditorCaption": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"$type": "Document",
|
"$type": "Document",
|
||||||
|
@ -57,7 +58,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": "AgIAAAAAAAAAAAAAAAAAAA0AAAAXAAAAAAAAAA==",
|
"ViewState": "AgIAADoAAAAAAAAAAAAAAGgAAAAAAAAAAAAAAA==",
|
||||||
"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,13 +6,13 @@
|
||||||
"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\\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}",
|
"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}"
|
"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}",
|
||||||
|
"RelativeMoniker": "D:0:0:{41CA5E6D-695E-47A8-9C50-9B4BFF31D3A5}|Program.csproj|solutionrelative:jatekos.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"DocumentGroupContainers": [
|
"DocumentGroupContainers": [
|
||||||
|
@ -26,7 +26,7 @@
|
||||||
"Children": [
|
"Children": [
|
||||||
{
|
{
|
||||||
"$type": "Document",
|
"$type": "Document",
|
||||||
"DocumentIndex": 1,
|
"DocumentIndex": 2,
|
||||||
"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",
|
||||||
|
@ -39,15 +39,16 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"$type": "Document",
|
"$type": "Document",
|
||||||
"DocumentIndex": 2,
|
"DocumentIndex": 1,
|
||||||
"Title": "Idopont.cs",
|
"Title": "Idopont.cs",
|
||||||
"DocumentMoniker": "E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_2\\Program\\Idopont.cs",
|
"DocumentMoniker": "E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_2\\Program\\Idopont.cs",
|
||||||
"RelativeDocumentMoniker": "Idopont.cs",
|
"RelativeDocumentMoniker": "Idopont.cs",
|
||||||
"ToolTip": "E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_2\\Program\\Idopont.cs",
|
"ToolTip": "E:\\H\u00E1zi\\13.oszt\u00E1ly\\Neumann_Verseny\\fordulo_2\\Program\\Idopont.cs",
|
||||||
"RelativeToolTip": "Idopont.cs",
|
"RelativeToolTip": "Idopont.cs",
|
||||||
"ViewState": "AgIAAAIAAAAAAAAAAAAAwC4AAAAJAAAAAAAAAA==",
|
"ViewState": "AgIAAAgAAAAAAAAAAAAAwC4AAAAJAAAAAAAAAA==",
|
||||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||||
"WhenOpened": "2025-03-05T11:46:26.985Z"
|
"WhenOpened": "2025-03-05T11:46:26.985Z",
|
||||||
|
"EditorCaption": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"$type": "Document",
|
"$type": "Document",
|
||||||
|
@ -57,7 +58,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": "AgIAAAAAAAAAAAAAAAAAAA0AAAAMAAAAAAAAAA==",
|
"ViewState": "AgIAAEMAAAAAAAAAAAAAAGkAAAANAAAAAAAAAA==",
|
||||||
"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": ""
|
||||||
|
|
|
@ -11,9 +11,8 @@ namespace Program
|
||||||
{
|
{
|
||||||
static void Main(string[] args)
|
static void Main(string[] args)
|
||||||
{
|
{
|
||||||
Feladat1();
|
//Feladat1();
|
||||||
//Feladat2();
|
Feladat2();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Feladat2()
|
static void Feladat2()
|
||||||
|
@ -29,7 +28,7 @@ namespace Program
|
||||||
var data = File.ReadAllText(path).Trim();
|
var data = File.ReadAllText(path).Trim();
|
||||||
foreach (char c in data)
|
foreach (char c in data)
|
||||||
{
|
{
|
||||||
dobasok.Add(Convert.ToInt32(c));
|
dobasok.Add(Convert.ToInt32($"{c}"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -40,9 +39,71 @@ namespace Program
|
||||||
|
|
||||||
foreach (char c in data2)
|
foreach (char c in data2)
|
||||||
{
|
{
|
||||||
dontesek.Add(Convert.ToInt32(c));
|
dontesek.Add(Convert.ToInt32($"{c}"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Jatekos alfa = new Jatekos();
|
||||||
|
alfa.Nev = "Alfa";
|
||||||
|
Jatekos beta = new Jatekos();
|
||||||
|
beta.Nev = "Beta";
|
||||||
|
Jatekos gamma = new Jatekos();
|
||||||
|
gamma.Nev = "Gamma";
|
||||||
|
|
||||||
|
List<Jatekos> jatekosok = new List<Jatekos>();
|
||||||
|
jatekosok.Add(alfa);
|
||||||
|
jatekosok.Add(beta);
|
||||||
|
jatekosok.Add(gamma);
|
||||||
|
|
||||||
|
List<Kor> korok = new List<Kor>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
List<int> dobasokSmallerScope = new List<int>();
|
||||||
|
|
||||||
|
int jatekosCounter = 0;
|
||||||
|
|
||||||
|
for (int i = 0; i < dobasok.Count; i++)
|
||||||
|
{
|
||||||
|
int dobas = dobasok[i];
|
||||||
|
int dontes = dontesek[i];
|
||||||
|
|
||||||
|
if (dontes == 1)
|
||||||
|
{
|
||||||
|
dobasokSmallerScope.Add(dobas);
|
||||||
|
|
||||||
|
if (dobasokSmallerScope.Count == 5)
|
||||||
|
{
|
||||||
|
Kor kor = new Kor();
|
||||||
|
kor.dobasok = dobasokSmallerScope.ToArray();
|
||||||
|
kor.jatekos = jatekosok[jatekosCounter];
|
||||||
|
|
||||||
|
korok.Add(kor);
|
||||||
|
|
||||||
|
dobasokSmallerScope.Clear();
|
||||||
|
|
||||||
|
if (jatekosCounter == 2)
|
||||||
|
{
|
||||||
|
jatekosCounter = 0;
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
jatekosCounter++;
|
||||||
|
}
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// a feladat
|
||||||
|
Console.WriteLine($"Teljes körök száma: {korok.Count / 3}");
|
||||||
|
|
||||||
|
// b feladat
|
||||||
|
foreach (var item in korok)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -26,7 +26,7 @@
|
||||||
- c: `1|15:37`
|
- c: `1|15:37`
|
||||||
|
|
||||||
### 2. feladat
|
### 2. feladat
|
||||||
- a: ``
|
- a: `14`
|
||||||
- b: ``
|
- b: ``
|
||||||
- c: ``
|
- c: ``
|
||||||
- d: ``
|
- d: ``
|
||||||
|
|
Loading…
Reference in New Issue
Block a user