added adatstrukturak

This commit is contained in:
szabomarton committed 2025-01-29 09:18:00 +01:00
commit 6c466bc3f4
127 files changed
+2929

No files matched your search

BIN
View File
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,37 @@
{
"Version": 1,
"WorkspaceRootPath": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20250109\\ConsoleApp1\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{384B95C5-77D4-4CC8-86E2-D39132973D06}|ConsoleApp1\\ConsoleApp1.csproj|c:\\users\\szabomarton\\desktop\\c#\\progaora\\20250109\\consoleapp1\\consoleapp1\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{384B95C5-77D4-4CC8-86E2-D39132973D06}|ConsoleApp1\\ConsoleApp1.csproj|solutionrelative:consoleapp1\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
}
],
"DocumentGroupContainers": [
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 0,
"Children": [
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "Program.cs",
"DocumentMoniker": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20250109\\ConsoleApp1\\ConsoleApp1\\Program.cs",
"RelativeDocumentMoniker": "ConsoleApp1\\Program.cs",
"ToolTip": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20250109\\ConsoleApp1\\ConsoleApp1\\Program.cs",
"RelativeToolTip": "ConsoleApp1\\Program.cs",
"ViewState": "AgIAAD8AAAAAAAAAAAAqwFcAAAAiAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2025-01-09T07:16:29.377Z",
"EditorCaption": ""
}
]
}
]
}
]
}
@@ -0,0 +1,37 @@
{
"Version": 1,
"WorkspaceRootPath": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20250109\\ConsoleApp1\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{384B95C5-77D4-4CC8-86E2-D39132973D06}|ConsoleApp1\\ConsoleApp1.csproj|c:\\users\\szabomarton\\desktop\\c#\\progaora\\20250109\\consoleapp1\\consoleapp1\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{384B95C5-77D4-4CC8-86E2-D39132973D06}|ConsoleApp1\\ConsoleApp1.csproj|solutionrelative:consoleapp1\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
}
],
"DocumentGroupContainers": [
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 0,
"Children": [
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "Program.cs",
"DocumentMoniker": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20250109\\ConsoleApp1\\ConsoleApp1\\Program.cs",
"RelativeDocumentMoniker": "ConsoleApp1\\Program.cs",
"ToolTip": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20250109\\ConsoleApp1\\ConsoleApp1\\Program.cs",
"RelativeToolTip": "ConsoleApp1\\Program.cs",
"ViewState": "AgIAAD8AAAAAAAAAAAAQwEgAAAAvAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2025-01-09T07:16:29.377Z",
"EditorCaption": ""
}
]
}
]
}
]
}
+25
View File
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.11.35222.181
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp1", "ConsoleApp1\ConsoleApp1.csproj", "{384B95C5-77D4-4CC8-86E2-D39132973D06}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{384B95C5-77D4-4CC8-86E2-D39132973D06}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{384B95C5-77D4-4CC8-86E2-D39132973D06}.Debug|Any CPU.Build.0 = Debug|Any CPU
{384B95C5-77D4-4CC8-86E2-D39132973D06}.Release|Any CPU.ActiveCfg = Release|Any CPU
{384B95C5-77D4-4CC8-86E2-D39132973D06}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DD6E9B96-D2BD-4E54-B4FC-B63016DC2BE5}
EndGlobalSection
EndGlobal
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{384B95C5-77D4-4CC8-86E2-D39132973D06}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>ConsoleApp1</RootNamespace>
<AssemblyName>ConsoleApp1</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
@@ -0,0 +1,99 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
internal class Program
{
static void TombKiir(int[] tomb)
{
foreach (int i in tomb)
{
Console.Write($"{i}, ");
}
Console.WriteLine();
}
public static void Gyorsrendez(int[] tomb, int eleje, int vege)
{
if (eleje < vege) {
int kozepe = Feloszt(tomb, eleje, vege);
Gyorsrendez(tomb, eleje, kozepe - 1);
Gyorsrendez(tomb, kozepe + 1, vege);
}
}
public static int Feloszt(int[] tomb, int eleje, int vege)
{
int kozepe = tomb[vege];
int kozepindex = eleje;
for (int i = eleje; i < vege; i++)
{
if (tomb[i] <= kozepe)
{
int temp = tomb[i];
tomb[i] = tomb[kozepindex];
tomb[kozepindex] = temp;
kozepindex++;
}
}
int kozepindexErteke = tomb[kozepindex];
tomb[kozepindex] = tomb[vege];
tomb[vege] = kozepindexErteke;
return kozepindex;
}
public static Int64 Faktorialis(Int64 szam)
{
if (szam == 1)
{
return 1;
}
return szam * Faktorialis(szam - 1);
}
public static Int64 Fib(Int64 num)
{
if (num == 1)
{
return 1;
}
if (num == 0)
{
return 0;
}
return Fib(num - 1) + Fib(num - 2);
}
static void Main(string[] args)
{
/*
var tomb = new int[] { 9, 6, 0, 0, 1, 2, 2, 2, 3, 1, 5, 4, 8, 2, 8, 6 };
Console.WriteLine("Rendezés előtt: ");
TombKiir(tomb);
Console.WriteLine("Gyors rendezés: ");
Gyorsrendez(tomb, 0, tomb.Length - 1);
TombKiir(tomb);
*/
for (int i = 1; i < 20; i++)
{
//Console.WriteLine($"{i}. faktoriális {Faktorialis(i)}");
Console.WriteLine($"{i}. fibonacci: {Fib(i)} ");
}
Console.ReadLine();
}
}
}
@@ -0,0 +1,33 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ConsoleApp1")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ConsoleApp1")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("384b95c5-77d4-4cc8-86e2-d39132973d06")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>
@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
@@ -0,0 +1 @@
137ddb1975586287657f37337b64d051167bb6a147915d9fb5b8eb94b1093509
@@ -0,0 +1,7 @@
C:\Users\szabomarton\Desktop\C#\ProgaOra\20250109\ConsoleApp1\ConsoleApp1\bin\Debug\ConsoleApp1.exe.config
C:\Users\szabomarton\Desktop\C#\ProgaOra\20250109\ConsoleApp1\ConsoleApp1\bin\Debug\ConsoleApp1.exe
C:\Users\szabomarton\Desktop\C#\ProgaOra\20250109\ConsoleApp1\ConsoleApp1\bin\Debug\ConsoleApp1.pdb
C:\Users\szabomarton\Desktop\C#\ProgaOra\20250109\ConsoleApp1\ConsoleApp1\obj\Debug\ConsoleApp1.csproj.AssemblyReference.cache
C:\Users\szabomarton\Desktop\C#\ProgaOra\20250109\ConsoleApp1\ConsoleApp1\obj\Debug\ConsoleApp1.csproj.CoreCompileInputs.cache
C:\Users\szabomarton\Desktop\C#\ProgaOra\20250109\ConsoleApp1\ConsoleApp1\obj\Debug\ConsoleApp1.exe
C:\Users\szabomarton\Desktop\C#\ProgaOra\20250109\ConsoleApp1\ConsoleApp1\obj\Debug\ConsoleApp1.pdb
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,37 @@
{
"Version": 1,
"WorkspaceRootPath": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20250115\\ConsoleApp1\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{1253C52B-9EE2-419E-8ACF-C9DB566348E9}|ConsoleApp1\\ConsoleApp1.csproj|c:\\users\\szabomarton\\desktop\\c#\\progaora\\20250115\\consoleapp1\\consoleapp1\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{1253C52B-9EE2-419E-8ACF-C9DB566348E9}|ConsoleApp1\\ConsoleApp1.csproj|solutionrelative:consoleapp1\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
}
],
"DocumentGroupContainers": [
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 0,
"Children": [
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "Program.cs",
"DocumentMoniker": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20250115\\ConsoleApp1\\ConsoleApp1\\Program.cs",
"RelativeDocumentMoniker": "ConsoleApp1\\Program.cs",
"ToolTip": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20250115\\ConsoleApp1\\ConsoleApp1\\Program.cs",
"RelativeToolTip": "ConsoleApp1\\Program.cs",
"ViewState": "AgIAAG8BAAAAAAAAAAAqwIMBAAAeAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2025-01-15T11:04:49.38Z",
"EditorCaption": ""
}
]
}
]
}
]
}
@@ -0,0 +1,37 @@
{
"Version": 1,
"WorkspaceRootPath": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20250115\\ConsoleApp1\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{1253C52B-9EE2-419E-8ACF-C9DB566348E9}|ConsoleApp1\\ConsoleApp1.csproj|c:\\users\\szabomarton\\desktop\\c#\\progaora\\20250115\\consoleapp1\\consoleapp1\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{1253C52B-9EE2-419E-8ACF-C9DB566348E9}|ConsoleApp1\\ConsoleApp1.csproj|solutionrelative:consoleapp1\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
}
],
"DocumentGroupContainers": [
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 0,
"Children": [
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "Program.cs",
"DocumentMoniker": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20250115\\ConsoleApp1\\ConsoleApp1\\Program.cs",
"RelativeDocumentMoniker": "ConsoleApp1\\Program.cs",
"ToolTip": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20250115\\ConsoleApp1\\ConsoleApp1\\Program.cs",
"RelativeToolTip": "ConsoleApp1\\Program.cs",
"ViewState": "AgIAAIEBAAAAAAAAAAAqwIEBAAAqAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2025-01-15T11:04:49.38Z",
"EditorCaption": ""
}
]
}
]
}
]
}
+25
View File
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.11.35222.181
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp1", "ConsoleApp1\ConsoleApp1.csproj", "{1253C52B-9EE2-419E-8ACF-C9DB566348E9}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1253C52B-9EE2-419E-8ACF-C9DB566348E9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1253C52B-9EE2-419E-8ACF-C9DB566348E9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1253C52B-9EE2-419E-8ACF-C9DB566348E9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1253C52B-9EE2-419E-8ACF-C9DB566348E9}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {5A66E34C-F969-4135-ADD8-93ABDBB4CB3A}
EndGlobalSection
EndGlobal
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{1253C52B-9EE2-419E-8ACF-C9DB566348E9}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>ConsoleApp1</RootNamespace>
<AssemblyName>ConsoleApp1</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
+402
View File
@@ -0,0 +1,402 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
namespace ConsoleApp1
{
public class ListaElem<T>
{
public ListaElem<T> Next { get; set; }
public T Value { get; set; }
}
public class LancoltLista<T>: IEnumerable<T>
{
public ListaElem<T> Start { get; private set; }
public ListaElem<T> End { get; private set; }
public void Add(T value)
{
var next = new ListaElem<T> { Value = value };
if (Start == null)
{
Start = next;
End = next;
} else
{
End.Next = next;
End = next;
}
}
private bool Equals(T value, T other)
{
if (ReferenceEquals(value, other))
{
return true;
} else
{
return value.Equals(other);
}
}
public bool Remove(T value)
{
ListaElem<T> previous = null;
ListaElem<T> current = Start;
while (current != null)
{
if (Equals(current.Value, value))
{
if (previous != null)
{
previous.Next = current.Next;
if (current.Next == null)
{
End = previous;
}
}
else
{
Start = Start.Next;
if (Start == null)
{
End = null;
}
}
return true;
}
previous = current;
current = current.Next;
}
return false;
}
public bool Contains(T value)
{
var current = Start;
while (current != null)
{
if (Equals(current.Value, value))
{
return true;
}
current = current.Next;
}
return false;
}
public IEnumerator<T> GetEnumerator()
{
var current = Start;
while (current != null)
{
var retval = current.Value;
current = current.Next;
yield return retval;
}
}
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
}
public class Verem<T> : IEnumerable<T>
{
private List<T> _lista;
public Verem()
{
_lista = new List<T>();
}
public void Push(T value)
{
_lista.Add(value);
}
int Count
{
get { return _lista.Count; }
}
public T Pop()
{
int vege = _lista.Count - 1;
T ret = _lista[vege];
_lista.RemoveAt(vege);
return ret;
}
public T Peak()
{
int vege = _lista.Count - 1;
return _lista[vege];
}
public IEnumerator<T> GetEnumerator()
{
for (int i = _lista.Count - 1; i >= 0; i--)
{
yield return _lista[i];
}
}
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
}
public class Csomopont
{
public int Adat { get; set; }
public Csomopont Bal { get; set; }
public Csomopont Jobb { get; set; }
public Csomopont(int adat)
{
this.Adat = adat;
this.Bal = null;
this.Jobb = null;
}
}
public class BinarisFa
{
public Csomopont Gyoker { get; private set; }
public void Add(int adat)
{
Gyoker = AddRekurziv(Gyoker, adat);
}
private Csomopont AddRekurziv(Csomopont csomopont, int adat)
{
if (csomopont == null)
{
return new Csomopont(adat);
}
if (adat < csomopont.Adat)
{
csomopont.Bal = AddRekurziv(csomopont.Bal, adat);
}
if (adat > csomopont.Adat)
{
csomopont.Jobb = AddRekurziv(csomopont.Jobb, adat);
}
return csomopont;
}
public void InorderBejaras()
{
Console.WriteLine("Inorder bejárás:");
InorderRekurziv(Gyoker);
Console.WriteLine();
}
private void InorderRekurziv(Csomopont csomopont)
{
if (csomopont == null)
{
return;
}
InorderRekurziv(csomopont.Bal);
Console.WriteLine($"{csomopont.Adat}, ");
InorderRekurziv(csomopont.Jobb);
}
}
internal class Program
{
public static int BinarisKereses(int[] arr, int value)
{
int eleje = 0;
int vege = arr.Length - 1;
while (eleje <= vege)
{
int i = (eleje + vege) / 2;
if (arr[i] == value)
{
return i;
}
else if (arr[i] < value)
{
eleje = i + 1;
}
else if (arr[i] > value) {
vege = i - 1;
}
}
return -1;
}
public static int[] Buborekrendezes(int[] arr)
{
for (int i = arr.Length - 1; i > 0; i--)
{
for (int j = 0; j < i; j++)
{
if (arr[j] > arr[i])
{
int tmp = arr[j];
arr[j] = arr[i];
arr[i] = tmp;
}
}
}
return arr;
}
public static int[] BeszuroRendez(int[] arr) {
for (int i = 1; i < arr.Length; i++)
{
int j = i - 1;
var temp = arr[i];
while ((j >= 0) && arr[j] > temp)
{
arr[j + 1] = arr[j];
j--;
}
arr[j + 1] = temp;
}
return arr;
}
public static void Gyorsrendez(int[] tomb, int eleje, int vege)
{
if (eleje < vege)
{
int kozepe = Feloszt(tomb, eleje, vege);
Gyorsrendez(tomb, eleje, kozepe - 1);
Gyorsrendez(tomb, kozepe + 1, vege);
}
}
public static int Feloszt(int[] tomb, int eleje, int vege)
{
int kozepe = tomb[vege];
int kozepindex = eleje;
for (int i = eleje; i < vege; i++)
{
if (tomb[i] <= kozepe)
{
int temp = tomb[i];
tomb[i] = tomb[kozepindex];
tomb[kozepindex] = temp;
kozepindex++;
}
}
int kozepindexErteke = tomb[kozepindex];
tomb[kozepindex] = tomb[vege];
tomb[vege] = kozepindexErteke;
return kozepindex;
}
static void Main(string[] args)
{
var lancolt = new LancoltLista<int>();
lancolt.Add(1);
lancolt.Add(2);
lancolt.Add(3);
lancolt.Add(4);
lancolt.Add(5);
foreach (var item in lancolt)
{
Console.WriteLine(item);
}
lancolt.Remove(1);
foreach (var item in lancolt)
{
Console.WriteLine(item);
}
var verem = new Verem<int>();
verem.Push(11);
verem.Push(12);
verem.Push(13);
verem.Push(14);
verem.Push(15);
Console.WriteLine("A verem elemei: ");
foreach (var item in verem)
{
Console.WriteLine(item);
}
Console.WriteLine("Pop:");
Console.WriteLine(verem.Pop());
BinarisFa binarisFa = new BinarisFa();
binarisFa.Add(5);
binarisFa.Add(2);
binarisFa.Add(8);
binarisFa.Add(1);
binarisFa.Add(7);
binarisFa.InorderBejaras();
int[] tomb = { 1, 12, 5, 6, 7, 3, 4, 2, 10, 11, 9, 8 };
Console.WriteLine("Tömb: ");
foreach (var item in tomb)
{
Console.Write($"{item} ");
}
Console.WriteLine();
Console.WriteLine($"a 4-es elem indexe: {BinarisKereses(tomb, 4)}");
Console.Write($"A tömb buborékrendezve:");
int[] bubi = Buborekrendezes(tomb);
foreach (var item in bubi)
{
Console.Write($"{item} ");
}
int[] beszuro = BeszuroRendez(tomb);
Console.WriteLine();
Console.WriteLine("Beszuro rendez: ");
foreach (var item in beszuro)
{
Console.Write($"{item} ");
}
Console.WriteLine();
Console.WriteLine("Gyorsrendezés: ");
Gyorsrendez(tomb, 0, tomb.Length - 1);
foreach (var item in tomb)
{
Console.Write($"{item} ");
}
Console.ReadKey();
}
}
}
@@ -0,0 +1,33 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ConsoleApp1")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ConsoleApp1")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("1253c52b-9ee2-419e-8acf-c9db566348e9")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>
@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
@@ -0,0 +1 @@
137ddb1975586287657f37337b64d051167bb6a147915d9fb5b8eb94b1093509
@@ -0,0 +1,14 @@
C:\Users\szabomarton\Desktop\ProgaOra\20250115\ConsoleApp1\ConsoleApp1\bin\Debug\ConsoleApp1.exe.config
C:\Users\szabomarton\Desktop\ProgaOra\20250115\ConsoleApp1\ConsoleApp1\bin\Debug\ConsoleApp1.exe
C:\Users\szabomarton\Desktop\ProgaOra\20250115\ConsoleApp1\ConsoleApp1\bin\Debug\ConsoleApp1.pdb
C:\Users\szabomarton\Desktop\ProgaOra\20250115\ConsoleApp1\ConsoleApp1\obj\Debug\ConsoleApp1.csproj.AssemblyReference.cache
C:\Users\szabomarton\Desktop\ProgaOra\20250115\ConsoleApp1\ConsoleApp1\obj\Debug\ConsoleApp1.csproj.CoreCompileInputs.cache
C:\Users\szabomarton\Desktop\ProgaOra\20250115\ConsoleApp1\ConsoleApp1\obj\Debug\ConsoleApp1.exe
C:\Users\szabomarton\Desktop\ProgaOra\20250115\ConsoleApp1\ConsoleApp1\obj\Debug\ConsoleApp1.pdb
C:\Users\szabomarton\Desktop\C#\ProgaOra\20250115\ConsoleApp1\ConsoleApp1\bin\Debug\ConsoleApp1.exe.config
C:\Users\szabomarton\Desktop\C#\ProgaOra\20250115\ConsoleApp1\ConsoleApp1\bin\Debug\ConsoleApp1.exe
C:\Users\szabomarton\Desktop\C#\ProgaOra\20250115\ConsoleApp1\ConsoleApp1\bin\Debug\ConsoleApp1.pdb
C:\Users\szabomarton\Desktop\C#\ProgaOra\20250115\ConsoleApp1\ConsoleApp1\obj\Debug\ConsoleApp1.csproj.AssemblyReference.cache
C:\Users\szabomarton\Desktop\C#\ProgaOra\20250115\ConsoleApp1\ConsoleApp1\obj\Debug\ConsoleApp1.csproj.CoreCompileInputs.cache
C:\Users\szabomarton\Desktop\C#\ProgaOra\20250115\ConsoleApp1\ConsoleApp1\obj\Debug\ConsoleApp1.exe
C:\Users\szabomarton\Desktop\C#\ProgaOra\20250115\ConsoleApp1\ConsoleApp1\obj\Debug\ConsoleApp1.pdb
Binary file not shown.
+22
View File
@@ -0,0 +1,22 @@
using System;
using System.IO;
using System.Collections.Generic;
namespace LinkedList_Gyak
{
public Class Lancoltlista{
public int value;
//public Lancoltlista *pointer;
public Lancoltlista(int value){
this.value = value;
}
}
internal class Program{
static void Main(string[] args){
Lancoltlista elem = new Lancoltlista(1);
Console.WriteLine(elem.value);
}
}
}
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,37 @@
{
"Version": 1,
"WorkspaceRootPath": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20250122\\Kor\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{08AC5912-8134-4A14-A3EC-C61822BA59AA}|Kor\\Kor.csproj|c:\\users\\szabomarton\\desktop\\c#\\progaora\\20250122\\kor\\kor\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{08AC5912-8134-4A14-A3EC-C61822BA59AA}|Kor\\Kor.csproj|solutionrelative:kor\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
}
],
"DocumentGroupContainers": [
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 0,
"Children": [
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "Program.cs",
"DocumentMoniker": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20250122\\Kor\\Kor\\Program.cs",
"RelativeDocumentMoniker": "Kor\\Program.cs",
"ToolTip": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20250122\\Kor\\Kor\\Program.cs",
"RelativeToolTip": "Kor\\Program.cs",
"ViewState": "AgIAAKgAAAAAAAAAAAAAALsAAAA4AAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2025-01-22T11:07:50.634Z",
"EditorCaption": ""
}
]
}
]
}
]
}
@@ -0,0 +1,37 @@
{
"Version": 1,
"WorkspaceRootPath": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20250122\\Kor\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{08AC5912-8134-4A14-A3EC-C61822BA59AA}|Kor\\Kor.csproj|c:\\users\\szabomarton\\desktop\\c#\\progaora\\20250122\\kor\\kor\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{08AC5912-8134-4A14-A3EC-C61822BA59AA}|Kor\\Kor.csproj|solutionrelative:kor\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
}
],
"DocumentGroupContainers": [
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 0,
"Children": [
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "Program.cs",
"DocumentMoniker": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20250122\\Kor\\Kor\\Program.cs",
"RelativeDocumentMoniker": "Kor\\Program.cs",
"ToolTip": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20250122\\Kor\\Kor\\Program.cs",
"RelativeToolTip": "Kor\\Program.cs",
"ViewState": "AgIAAKgAAAAAAAAAAAAAALsAAAA4AAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2025-01-22T11:07:50.634Z",
"EditorCaption": ""
}
]
}
]
}
]
}
+25
View File
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.11.35222.181
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Kor", "Kor\Kor.csproj", "{08AC5912-8134-4A14-A3EC-C61822BA59AA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{08AC5912-8134-4A14-A3EC-C61822BA59AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{08AC5912-8134-4A14-A3EC-C61822BA59AA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{08AC5912-8134-4A14-A3EC-C61822BA59AA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{08AC5912-8134-4A14-A3EC-C61822BA59AA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {2395C132-B3DA-4C13-A3F5-51E6A89E79F5}
EndGlobalSection
EndGlobal
@@ -0,0 +1 @@
{"RootPath":"C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20250122\\Kor\\Kor","ProjectFileName":"Kor.csproj","Configuration":"Debug|AnyCPU","FrameworkPath":"","Sources":[{"SourceFile":"Program.cs"},{"SourceFile":"Properties\\AssemblyInfo.cs"},{"SourceFile":"obj\\Debug\\.NETFramework,Version=v4.7.2.AssemblyAttributes.cs"}],"References":[{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\Microsoft.CSharp.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\mscorlib.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Data.DataSetExtensions.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Data.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Net.Http.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Xml.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Xml.Linq.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""}],"Analyzers":[],"Outputs":[{"OutputItemFullPath":"C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20250122\\Kor\\Kor\\bin\\Debug\\Kor.exe","OutputItemRelativePath":"Kor.exe"},{"OutputItemFullPath":"","OutputItemRelativePath":""}],"CopyToOutputEntries":[]}
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>
+53
View File
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{08AC5912-8134-4A14-A3EC-C61822BA59AA}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>Kor</RootNamespace>
<AssemblyName>Kor</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
+192
View File
@@ -0,0 +1,192 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http.Headers;
using System.Runtime.Remoting.Messaging;
using System.Text;
using System.Threading.Tasks;
namespace Kor
{
public class Kor
{
public double sugar { get; set; }
public Kor(double sugar)
{
this.sugar = sugar;
}
public void Meretvaltoztata(double meret)
{
this.sugar = meret;
}
public double Kerulet()
{
return sugar * 2 * Math.PI;
}
public double Terulet()
{
return sugar * sugar * Math.PI;
}
}
public class SzinesKor : Kor
{
public string szin;
public SzinesKor(double sugar, string szin) : base(sugar)
{
this.sugar = sugar;
this.szin = szin;
}
}
public class Auto
{
public string nev;
public double fogyasztas;
public double benzintank;
public double MAX_benzintank;
public Auto(string nev, double fogyasztas, double benzintank, double MAX_benzintank) {
this.nev = nev;
this.fogyasztas = fogyasztas;
this.benzintank = benzintank;
this.MAX_benzintank = MAX_benzintank;
}
}
public class Benzinkut
{
public double benzin; //jelenleg tárolt benzin mennyisége
public double literAr; // benzin ára literenként
public double kassza;
public Benzinkut(double benzin, double literAr, double kassza)
{
this.benzin = benzin;
this.literAr = literAr;
this.kassza = kassza;
}
public void Tankolas(Auto auto, Sofor sofor)
{
if (benzin - auto.MAX_benzintank > 0 && sofor.penz >= this.literAr * auto.MAX_benzintank)
{
auto.benzintank = auto.MAX_benzintank;
benzin -= auto.MAX_benzintank;
int fizetendo = (int)auto.MAX_benzintank * (int)this.literAr;
sofor.penz -= fizetendo;
this.kassza += fizetendo;
}
}
}
public class Sofor
{
public string nev;
public int penz;
public Sofor(string nev, int penz)
{
this.nev = nev;
this.penz = penz;
}
}
public class Munkavallalo
{
public string nev;
public string fizetesiKategoria;
public int evesSzabadsag;
public int kivettSzabadsag = 0;
public Munkavallalo(string nev, string fizetesiKategoria)
{
this.nev= nev;
this.fizetesiKategoria = fizetesiKategoria;
}
public Munkavallalo(string nev, string fizetesiKategoria, int evesSzabadsag)
{
this.nev = nev;
this.fizetesiKategoria = fizetesiKategoria;
this.evesSzabadsag = evesSzabadsag;
}
public int KivehetoNapokSzama()
{
return evesSzabadsag - kivettSzabadsag;
}
}
class Szemely
{
public string nev;
public int magassag;
public int kor;
public Szemely(string nev, int magassag, int kor)
{
this.nev = nev;
this.magassag = magassag;
this.kor = kor;
}
}
internal class Program
{
public static bool OsszeIllenek(Szemely szemely1, Szemely szemely2)
{
if (
Math.Abs(szemely1.magassag - szemely2.magassag) <= 10
&& Math.Abs(szemely1.kor - szemely2.kor) <= 3)
{
return true;
}
return false;
}
static void Main(string[] args)
{
Kor kor = new Kor(1);
Console.WriteLine(kor.Terulet());
Console.WriteLine(kor.Kerulet());
Console.WriteLine();
SzinesKor szinesKor = new SzinesKor(2, "piros");
Console.WriteLine(szinesKor.Terulet());
Benzinkut benzinkut = new Benzinkut(1000, 500, 0);
Sofor sofor = new Sofor("Sanyi", 100000);
Auto auto = new Auto("Fiat", 5.3, 100, 100);
/*
while (sofor.penz > 0) {
auto.benzintank = 0;
benzinkut.Tankolas(auto, sofor);
Console.WriteLine($"A sofőr aktuális egyenlege: {sofor.penz}");
}
*/
Munkavallalo munkavallalo = new Munkavallalo("Sanyi", "1", 20);
Console.WriteLine(munkavallalo.KivehetoNapokSzama());
//4. feladat
Szemely lany = new Szemely("Anna", 150, 20);
Szemely fiu = new Szemely("Bence", 160, 21);
if (OsszeIllenek(fiu, lany))
{
Console.WriteLine("Összeillenek");
} else
{
Console.WriteLine("Nem illenek össze.");
}
}
}
}
@@ -0,0 +1,33 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Kor")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Kor")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("08ac5912-8134-4a14-a3ec-c61822ba59aa")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Binary file not shown.
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>
Binary file not shown.
@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
@@ -0,0 +1 @@
137ddb1975586287657f37337b64d051167bb6a147915d9fb5b8eb94b1093509
@@ -0,0 +1,14 @@
C:\Users\szabomarton\Desktop\ProgaOra\20250122\Kor\Kor\bin\Debug\Kor.exe.config
C:\Users\szabomarton\Desktop\ProgaOra\20250122\Kor\Kor\bin\Debug\Kor.exe
C:\Users\szabomarton\Desktop\ProgaOra\20250122\Kor\Kor\bin\Debug\Kor.pdb
C:\Users\szabomarton\Desktop\ProgaOra\20250122\Kor\Kor\obj\Debug\Kor.csproj.AssemblyReference.cache
C:\Users\szabomarton\Desktop\ProgaOra\20250122\Kor\Kor\obj\Debug\Kor.csproj.CoreCompileInputs.cache
C:\Users\szabomarton\Desktop\ProgaOra\20250122\Kor\Kor\obj\Debug\Kor.exe
C:\Users\szabomarton\Desktop\ProgaOra\20250122\Kor\Kor\obj\Debug\Kor.pdb
C:\Users\szabomarton\Desktop\C#\ProgaOra\20250122\Kor\Kor\bin\Debug\Kor.exe.config
C:\Users\szabomarton\Desktop\C#\ProgaOra\20250122\Kor\Kor\bin\Debug\Kor.exe
C:\Users\szabomarton\Desktop\C#\ProgaOra\20250122\Kor\Kor\bin\Debug\Kor.pdb
C:\Users\szabomarton\Desktop\C#\ProgaOra\20250122\Kor\Kor\obj\Debug\Kor.csproj.AssemblyReference.cache
C:\Users\szabomarton\Desktop\C#\ProgaOra\20250122\Kor\Kor\obj\Debug\Kor.csproj.CoreCompileInputs.cache
C:\Users\szabomarton\Desktop\C#\ProgaOra\20250122\Kor\Kor\obj\Debug\Kor.exe
C:\Users\szabomarton\Desktop\C#\ProgaOra\20250122\Kor\Kor\obj\Debug\Kor.pdb
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,37 @@
{
"Version": 1,
"WorkspaceRootPath": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20250122\\Statisztika\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{47C2D77C-726C-4B42-8A0B-6C68BEC5A588}|Statisztika\\Statisztika.csproj|c:\\users\\szabomarton\\desktop\\c#\\progaora\\20250122\\statisztika\\statisztika\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{47C2D77C-726C-4B42-8A0B-6C68BEC5A588}|Statisztika\\Statisztika.csproj|solutionrelative:statisztika\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
}
],
"DocumentGroupContainers": [
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 0,
"Children": [
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "Program.cs",
"DocumentMoniker": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20250122\\Statisztika\\Statisztika\\Program.cs",
"RelativeDocumentMoniker": "Statisztika\\Program.cs",
"ToolTip": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20250122\\Statisztika\\Statisztika\\Program.cs",
"RelativeToolTip": "Statisztika\\Program.cs",
"ViewState": "AgIAACMAAAAAAAAAAAAqwDsAAAB+AAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2025-01-23T07:15:55.093Z",
"EditorCaption": ""
}
]
}
]
}
]
}
@@ -0,0 +1,37 @@
{
"Version": 1,
"WorkspaceRootPath": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20250122\\Statisztika\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{47C2D77C-726C-4B42-8A0B-6C68BEC5A588}|Statisztika\\Statisztika.csproj|c:\\users\\szabomarton\\desktop\\c#\\progaora\\20250122\\statisztika\\statisztika\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{47C2D77C-726C-4B42-8A0B-6C68BEC5A588}|Statisztika\\Statisztika.csproj|solutionrelative:statisztika\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
}
],
"DocumentGroupContainers": [
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 0,
"Children": [
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "Program.cs",
"DocumentMoniker": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20250122\\Statisztika\\Statisztika\\Program.cs",
"RelativeDocumentMoniker": "Statisztika\\Program.cs",
"ToolTip": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20250122\\Statisztika\\Statisztika\\Program.cs",
"RelativeToolTip": "Statisztika\\Program.cs",
"ViewState": "AgIAACMAAAAAAAAAAAAqwDsAAAB+AAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2025-01-23T07:15:55.093Z",
"EditorCaption": ""
}
]
}
]
}
]
}
+25
View File
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.11.35222.181
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Statisztika", "Statisztika\Statisztika.csproj", "{47C2D77C-726C-4B42-8A0B-6C68BEC5A588}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{47C2D77C-726C-4B42-8A0B-6C68BEC5A588}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{47C2D77C-726C-4B42-8A0B-6C68BEC5A588}.Debug|Any CPU.Build.0 = Debug|Any CPU
{47C2D77C-726C-4B42-8A0B-6C68BEC5A588}.Release|Any CPU.ActiveCfg = Release|Any CPU
{47C2D77C-726C-4B42-8A0B-6C68BEC5A588}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {2937FA6E-9287-42E7-9F7E-8A1F844E27B5}
EndGlobalSection
EndGlobal
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>
@@ -0,0 +1,72 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Statisztika
{
internal class Program
{
public static int Osszeg(List<int> values)
{
return values.Sum();
}
public static int Atlag(List<int> values)
{
return values.Sum() / values.Count();
}
static void Main(string[] args)
{
string path = args[0];
if (File.Exists(path))
{
FileStream fileStream = new FileStream(path, FileMode.Open, FileAccess.Read);
StreamReader streamReader = new StreamReader(fileStream);
List<int> values = new List<int>();
string line = streamReader.ReadLine();
while (line != null)
{
if(Int32.TryParse(line, out int num))
{
values.Add(num);
}
line = streamReader.ReadLine();
}
streamReader.Close();
fileStream.Close();
if (values.Count > 0)
{
Console.WriteLine($"A számok összege: {Osszeg(values)}");
Console.WriteLine($"A számok átlaga: {Atlag(values)}");
StreamWriter streamWriter = new StreamWriter("kimenet.txt");
streamWriter.WriteLine($"A számok összege: {Osszeg(values)}");
streamWriter.WriteLine($"A számok átlaga: {Atlag(values)}");
streamWriter.Close();
} else
{
Console.WriteLine("ERROR! A megadott fájlba nem szerepeltek számok, vagy azok nem jó formátumba voltak.");
}
}
else
{
Console.WriteLine("ERROR! A file nem létezik.");
}
}
}
}
@@ -0,0 +1,33 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Statisztika")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Statisztika")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("47c2d77c-726c-4b42-8a0b-6c68bec5a588")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{47C2D77C-726C-4B42-8A0B-6C68BEC5A588}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>Statisztika</RootNamespace>
<AssemblyName>Statisztika</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>
@@ -0,0 +1,10 @@
1
2
3
4
5
6
7
8
9
10
@@ -0,0 +1,2 @@
A számok összege: 3822
A számok átlaga: 764
@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
@@ -0,0 +1 @@
137ddb1975586287657f37337b64d051167bb6a147915d9fb5b8eb94b1093509
@@ -0,0 +1,7 @@
C:\Users\szabomarton\Desktop\C#\ProgaOra\20250122\Statisztika\Statisztika\bin\Debug\Statisztika.exe.config
C:\Users\szabomarton\Desktop\C#\ProgaOra\20250122\Statisztika\Statisztika\bin\Debug\Statisztika.exe
C:\Users\szabomarton\Desktop\C#\ProgaOra\20250122\Statisztika\Statisztika\bin\Debug\Statisztika.pdb
C:\Users\szabomarton\Desktop\C#\ProgaOra\20250122\Statisztika\Statisztika\obj\Debug\Statisztika.csproj.AssemblyReference.cache
C:\Users\szabomarton\Desktop\C#\ProgaOra\20250122\Statisztika\Statisztika\obj\Debug\Statisztika.csproj.CoreCompileInputs.cache
C:\Users\szabomarton\Desktop\C#\ProgaOra\20250122\Statisztika\Statisztika\obj\Debug\Statisztika.exe
C:\Users\szabomarton\Desktop\C#\ProgaOra\20250122\Statisztika\Statisztika\obj\Debug\Statisztika.pdb
Binary file not shown.
@@ -0,0 +1,53 @@
{
"Version": 1,
"WorkspaceRootPath": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20250122\\WpfStatisztika\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{829C5E78-9BC1-473E-8364-B7BBFC4A871C}|WpfStatisztika\\WpfStatisztika.csproj|c:\\users\\szabomarton\\desktop\\c#\\progaora\\20250122\\wpfstatisztika\\wpfstatisztika\\mainwindow.xaml.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{829C5E78-9BC1-473E-8364-B7BBFC4A871C}|WpfStatisztika\\WpfStatisztika.csproj|solutionrelative:wpfstatisztika\\mainwindow.xaml.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{829C5E78-9BC1-473E-8364-B7BBFC4A871C}|WpfStatisztika\\WpfStatisztika.csproj|c:\\users\\szabomarton\\desktop\\c#\\progaora\\20250122\\wpfstatisztika\\wpfstatisztika\\mainwindow.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}",
"RelativeMoniker": "D:0:0:{829C5E78-9BC1-473E-8364-B7BBFC4A871C}|WpfStatisztika\\WpfStatisztika.csproj|solutionrelative:wpfstatisztika\\mainwindow.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}"
}
],
"DocumentGroupContainers": [
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 0,
"Children": [
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "MainWindow.xaml.cs",
"DocumentMoniker": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20250122\\WpfStatisztika\\WpfStatisztika\\MainWindow.xaml.cs",
"RelativeDocumentMoniker": "WpfStatisztika\\MainWindow.xaml.cs",
"ToolTip": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20250122\\WpfStatisztika\\WpfStatisztika\\MainWindow.xaml.cs",
"RelativeToolTip": "WpfStatisztika\\MainWindow.xaml.cs",
"ViewState": "AgIAAGUAAAAAAAAAAAD4v3QAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2025-01-23T08:07:03.78Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 1,
"Title": "MainWindow.xaml",
"DocumentMoniker": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20250122\\WpfStatisztika\\WpfStatisztika\\MainWindow.xaml",
"RelativeDocumentMoniker": "WpfStatisztika\\MainWindow.xaml",
"ToolTip": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20250122\\WpfStatisztika\\WpfStatisztika\\MainWindow.xaml",
"RelativeToolTip": "WpfStatisztika\\MainWindow.xaml",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003549|",
"WhenOpened": "2025-01-23T08:07:04.079Z",
"EditorCaption": ""
}
]
}
]
}
]
}
@@ -0,0 +1,53 @@
{
"Version": 1,
"WorkspaceRootPath": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20250122\\WpfStatisztika\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{829C5E78-9BC1-473E-8364-B7BBFC4A871C}|WpfStatisztika\\WpfStatisztika.csproj|c:\\users\\szabomarton\\desktop\\c#\\progaora\\20250122\\wpfstatisztika\\wpfstatisztika\\mainwindow.xaml.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{829C5E78-9BC1-473E-8364-B7BBFC4A871C}|WpfStatisztika\\WpfStatisztika.csproj|solutionrelative:wpfstatisztika\\mainwindow.xaml.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{829C5E78-9BC1-473E-8364-B7BBFC4A871C}|WpfStatisztika\\WpfStatisztika.csproj|c:\\users\\szabomarton\\desktop\\c#\\progaora\\20250122\\wpfstatisztika\\wpfstatisztika\\mainwindow.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}",
"RelativeMoniker": "D:0:0:{829C5E78-9BC1-473E-8364-B7BBFC4A871C}|WpfStatisztika\\WpfStatisztika.csproj|solutionrelative:wpfstatisztika\\mainwindow.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}"
}
],
"DocumentGroupContainers": [
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 0,
"Children": [
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "MainWindow.xaml.cs",
"DocumentMoniker": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20250122\\WpfStatisztika\\WpfStatisztika\\MainWindow.xaml.cs",
"RelativeDocumentMoniker": "WpfStatisztika\\MainWindow.xaml.cs",
"ToolTip": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20250122\\WpfStatisztika\\WpfStatisztika\\MainWindow.xaml.cs",
"RelativeToolTip": "WpfStatisztika\\MainWindow.xaml.cs",
"ViewState": "AgIAAGUAAAAAAAAAAAD4v3QAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2025-01-23T08:07:03.78Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 1,
"Title": "MainWindow.xaml",
"DocumentMoniker": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20250122\\WpfStatisztika\\WpfStatisztika\\MainWindow.xaml",
"RelativeDocumentMoniker": "WpfStatisztika\\MainWindow.xaml",
"ToolTip": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20250122\\WpfStatisztika\\WpfStatisztika\\MainWindow.xaml",
"RelativeToolTip": "WpfStatisztika\\MainWindow.xaml",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003549|",
"WhenOpened": "2025-01-23T08:07:04.079Z",
"EditorCaption": ""
}
]
}
]
}
]
}
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.11.35222.181
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WpfStatisztika", "WpfStatisztika\WpfStatisztika.csproj", "{829C5E78-9BC1-473E-8364-B7BBFC4A871C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{829C5E78-9BC1-473E-8364-B7BBFC4A871C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{829C5E78-9BC1-473E-8364-B7BBFC4A871C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{829C5E78-9BC1-473E-8364-B7BBFC4A871C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{829C5E78-9BC1-473E-8364-B7BBFC4A871C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {86C389D6-1690-441F-A7FD-C4F096B87D5B}
EndGlobalSection
EndGlobal
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>
@@ -0,0 +1,9 @@
<Application x:Class="WpfStatisztika.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:WpfStatisztika"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
</Application>
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
namespace WpfStatisztika
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
}
@@ -0,0 +1,47 @@
<Window x:Class="WpfStatisztika.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfStatisztika"
mc:Ignorable="d"
Title="Statisztika" Height="450" Width="800">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="5*"></ColumnDefinition>
<ColumnDefinition Width="10*"></ColumnDefinition>
<ColumnDefinition Width="35*"></ColumnDefinition>
<ColumnDefinition Width="35*"></ColumnDefinition>
<ColumnDefinition Width="10*"></ColumnDefinition>
<ColumnDefinition Width="5*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="10*"></RowDefinition>
<RowDefinition Height="80*"></RowDefinition>
<RowDefinition Height="10*"></RowDefinition>
</Grid.RowDefinitions>
<Grid Grid.Row="1" Grid.Column="2">
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<TextBox Grid.Row="0" Width="100" Height="20" HorizontalAlignment="Center" VerticalAlignment="Center" x:Name="input">bemenet.txt</TextBox>
<Button Grid.Row="1" Width="140" Height="30" Click="Button_Click">File olvasása</Button>
<Button Grid.Row="2" Width="140" Height="30" Click="Save_Click">Kimenet mentése</Button>
</Grid>
<Grid Grid.Row="1" Grid.Column="3">
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<Label Grid.Row="0" x:Name="osszeg" ></Label>
<Label Grid.Row="1" x:Name="atlag" ></Label>
<Label Grid.Row="2" x:Name="min" ></Label>
<Label Grid.Row="3" x:Name="max" ></Label>
</Grid>
</Grid>
</Window>
@@ -0,0 +1,130 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace WpfStatisztika
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
///
public partial class MainWindow : Window
{
public static int Osszeg(List<int> values)
{
return values.Sum();
}
public static int Atlag(List<int> values)
{
return values.Sum() / values.Count();
}
public static int Min(List<int> values)
{
return values.Min();
}
public static int Max(List<int> values)
{
return values.Max();
}
public void FileRead(string path)
{
if (File.Exists(path))
{
FileStream fileStream = new FileStream(path, FileMode.Open, FileAccess.Read);
StreamReader streamReader = new StreamReader(fileStream);
List<int> values = new List<int>();
string line = streamReader.ReadLine();
while (line != null)
{
if (Int32.TryParse(line, out int num))
{
values.Add(num);
}
line = streamReader.ReadLine();
}
streamReader.Close();
fileStream.Close();
if (values.Count > 0)
{
osszeg.Content = $"A számok összege: {Osszeg(values)}";
atlag.Content = $"A számok átlaga: {Atlag(values)}";
min.Content = $"A legkisebb szám: {Min(values)}";
max.Content = $"A legnagyobb szám: {Max(values)}";
StreamWriter streamWriter = new StreamWriter("kimenet.txt");
streamWriter.WriteLine($"A számok összege: {Osszeg(values)}");
streamWriter.WriteLine($"A számok átlaga: {Atlag(values)}");
streamWriter.WriteLine($"A legkisebb szám: {Min(values)}");
streamWriter.WriteLine($"A legnagyobb szám: {Max(values)}");
streamWriter.Close();
}
else
{
Console.WriteLine("ERROR! A megadott fájlba nem szerepeltek számok, vagy azok nem jó formátumba voltak.");
}
}
else
{
Console.WriteLine("ERROR! A file nem létezik.");
MessageBox.Show("ERROR! A file nem létezik.");
}
}
public MainWindow()
{
InitializeComponent();
}
private void Button_Click(object sender, RoutedEventArgs e)
{
if (input.Text != "")
{
string path = input.Text;
FileRead(path);
} else
{
input.Text = "bemenet.txt";
string path = input.Text;
FileRead(path);
}
}
private void Save_Click(object sender, RoutedEventArgs e)
{
}
}
}
@@ -0,0 +1,52 @@
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("WpfStatisztika")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("WpfStatisztika")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
@@ -0,0 +1,71 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WpfStatisztika.Properties
{
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WpfStatisztika.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}
@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -0,0 +1,30 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WpfStatisztika.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}
Loaded 100 of 127 files, more files were not shown because too many files have changed in this diff. Show more