Add project files.
This commit is contained in:
128
Lottoszamok/Program.cs
Normal file
128
Lottoszamok/Program.cs
Normal file
@@ -0,0 +1,128 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Lottoszamok
|
||||
{
|
||||
internal class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
|
||||
|
||||
Console.WriteLine("1.Feladat");
|
||||
Console.WriteLine("Kérem az 52. hét hiányzó számait");
|
||||
|
||||
|
||||
string bekertszamok = Console.ReadLine();
|
||||
|
||||
List<string> lottoszamok = new List<string>();
|
||||
|
||||
StreamReader sr = new StreamReader(@"..\..\lottosz.txt");
|
||||
|
||||
while (!sr.EndOfStream)
|
||||
{
|
||||
lottoszamok.Add(sr.ReadLine());
|
||||
}
|
||||
sr.Close();
|
||||
|
||||
|
||||
|
||||
|
||||
bekertszamok = bekertszamok.Trim();
|
||||
List<string> bekertszamokdb_olva = bekertszamok.Split(' ').ToList();
|
||||
bekertszamokdb_olva.Sort();
|
||||
|
||||
bekertszamok = "";
|
||||
foreach (var szam in bekertszamokdb_olva)
|
||||
{
|
||||
bekertszamok = bekertszamok + ' ' + szam.ToString();
|
||||
}
|
||||
bekertszamok = bekertszamok.Trim();
|
||||
|
||||
|
||||
|
||||
Console.WriteLine($"A számok rendezve: {bekertszamok}");
|
||||
Console.WriteLine("3.Feladat");
|
||||
Console.WriteLine("Add meg melyik hetet vetítsem");
|
||||
int valasztotthet = int.Parse(Console.ReadLine());
|
||||
Console.WriteLine($"4.Feladat\nA választott hét lottószámai: {lottoszamok[valasztotthet]}");
|
||||
|
||||
|
||||
List<int> huzhatoszamok = new List<int>();
|
||||
|
||||
for (int i = 1; i < 91; i++)
|
||||
{
|
||||
huzhatoszamok.Add(i);
|
||||
}
|
||||
|
||||
|
||||
|
||||
List<int> latottszamok = new List<int>();
|
||||
|
||||
foreach (var item in lottoszamok)
|
||||
{
|
||||
|
||||
string[] szamfelbontvatemp = item.Split(' ');
|
||||
|
||||
foreach (var item1 in szamfelbontvatemp)
|
||||
{
|
||||
if (!latottszamok.Contains(int.Parse(item1)))
|
||||
{
|
||||
latottszamok.Add(int.Parse(item1));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
foreach (var item in lottoszamok)
|
||||
//ezeket a lottoszámokat még fel kell darabolni
|
||||
{
|
||||
if (!latottszamok.Contains(int.Parse(item)))
|
||||
{
|
||||
Console.WriteLine($"nem látott szám: {item}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//5.feladat maj megy ide
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
foreach (var item in lottoszamok)
|
||||
{
|
||||
Console.WriteLine(item);
|
||||
}
|
||||
*/
|
||||
|
||||
StreamWriter sw = new StreamWriter(@"..\..\lotto52.txt");
|
||||
|
||||
|
||||
/*
|
||||
sw.Write($"\n{bekertszamok}");
|
||||
sw.Close();
|
||||
*/
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user