added orai

This commit is contained in:
szabomarton
2025-01-23 10:13:31 +01:00
parent 33563aceba
commit bfcd5595b1
75 changed files with 1622 additions and 10 deletions

Binary file not shown.

View File

@@ -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": ""
}
]
}
]
}
]
}

View File

@@ -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": ""
}
]
}
]
}
]
}

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

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>

View File

@@ -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.");
}
}
}
}

View File

@@ -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")]

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>{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>

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>

View File

@@ -0,0 +1,10 @@
1
2
3
4
5
6
7
8
9
10

View File

@@ -0,0 +1,2 @@
A számok összege: 3822
A számok átlaga: 764

View File

@@ -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")]

View File

@@ -0,0 +1 @@
137ddb1975586287657f37337b64d051167bb6a147915d9fb5b8eb94b1093509

View File

@@ -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