A meccsdoga készen van
This commit is contained in:
parent
36ad626a41
commit
32a8b9d2df
|
@ -12,13 +12,74 @@ namespace MeccsDoga
|
|||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
//Beolvasás a merkozesek.tx fájlból 1. mód
|
||||
//Beolvasás a merkozesek.txt fájlból 1. mód
|
||||
StreamReader sr = new StreamReader(@"c:\git\merkozesek.txt");
|
||||
//egy sor beolvasása
|
||||
string elsosor = sr.ReadLine();
|
||||
Console.WriteLine($"Az állomány első sora: {elsosor}");
|
||||
//string elsosor = sr.ReadLine();
|
||||
//Console.WriteLine($"Az állomány első sora: {elsosor}");
|
||||
string[] meccsek = new string[400];
|
||||
int darab = 0;
|
||||
while(!sr.EndOfStream)
|
||||
{
|
||||
meccsek[darab] = sr.ReadLine();
|
||||
darab++;
|
||||
}
|
||||
sr.Close();
|
||||
Console.WriteLine($"A fájlban {darab} meccs adata van.");
|
||||
for (int i = 0; i < darab; i++)
|
||||
{
|
||||
Console.WriteLine(meccsek[i]);
|
||||
}
|
||||
|
||||
//******************************************
|
||||
//Beolvasás a merkozesek.txt fájlból 2. mód
|
||||
Console.WriteLine("Beolvasás 2. módszer ************************");
|
||||
string[] sorok = File.ReadAllLines(@"c:\git\merkozesek.txt");
|
||||
Console.WriteLine($"A fájlban {sorok.Length} meccs adata van.");
|
||||
foreach (string sor in sorok)
|
||||
{
|
||||
Console.WriteLine(sor);
|
||||
}
|
||||
|
||||
//2. feladat megoldása
|
||||
Console.WriteLine("Adja meg egy forduló számát (1-20):");
|
||||
string fordulo = Console.ReadLine();
|
||||
Console.WriteLine($"2. feladat:\nA {fordulo}. forduló mérkőzései:");
|
||||
foreach (var item in sorok)
|
||||
{
|
||||
if(item.StartsWith(fordulo))
|
||||
{
|
||||
//Console.WriteLine(item);
|
||||
string[] t = item.Split(' ');
|
||||
Console.WriteLine($"{t[3]}-{t[4]}: {t[1]}-{t[2]}");
|
||||
}
|
||||
}
|
||||
|
||||
//3. feladat megoldása
|
||||
Console.WriteLine("3. feladat:");
|
||||
int hazai = 0;
|
||||
int vendeg = 0;
|
||||
int remi = 0;
|
||||
foreach (var item in sorok)
|
||||
{
|
||||
string[] t = item.Split(' ');
|
||||
int hgol = int.Parse(t[1]);
|
||||
int vgol = int.Parse(t[2]);
|
||||
if(hgol>vgol)
|
||||
{
|
||||
hazai++;
|
||||
} else if(vgol>hgol)
|
||||
{
|
||||
vendeg++;
|
||||
} else
|
||||
{
|
||||
remi++;
|
||||
}
|
||||
}
|
||||
Console.WriteLine($"Hazai győzelem: {hazai} mérkőzésen");
|
||||
Console.WriteLine($"Vendég győzelem: {vendeg} mérkőzésen");
|
||||
Console.WriteLine($"Döntetlen: {remi} mérkőzésen");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
6
MeccsDogaObject/App.config
Normal file
6
MeccsDogaObject/App.config
Normal 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>
|
19
MeccsDogaObject/Meccs.cs
Normal file
19
MeccsDogaObject/Meccs.cs
Normal file
|
@ -0,0 +1,19 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MeccsDogaObject
|
||||
{
|
||||
class Meccs
|
||||
{
|
||||
public int fordulo;
|
||||
public int hazaigol;
|
||||
public int vendeggol;
|
||||
public string hazaicsapat;
|
||||
public string vendegcsapat;
|
||||
private bool este;
|
||||
|
||||
}
|
||||
}
|
54
MeccsDogaObject/MeccsDogaObject.csproj
Normal file
54
MeccsDogaObject/MeccsDogaObject.csproj
Normal file
|
@ -0,0 +1,54 @@
|
|||
<?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>{B0483911-FD39-46E1-BDA7-4773F1409664}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>MeccsDogaObject</RootNamespace>
|
||||
<AssemblyName>MeccsDogaObject</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="Meccs.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
24
MeccsDogaObject/Program.cs
Normal file
24
MeccsDogaObject/Program.cs
Normal file
|
@ -0,0 +1,24 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MeccsDogaObject
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
//A Meccs objektumok használata
|
||||
Meccs m1 = new Meccs();
|
||||
m1.fordulo = 15;
|
||||
m1.hazaigol = 2;
|
||||
m1.vendeggol = 1;
|
||||
m1.hazaicsapat = "gszisc";
|
||||
m1.vendegcsapat = "koosfc";
|
||||
Meccs m2 = new Meccs();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
36
MeccsDogaObject/Properties/AssemblyInfo.cs
Normal file
36
MeccsDogaObject/Properties/AssemblyInfo.cs
Normal file
|
@ -0,0 +1,36 @@
|
|||
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("MeccsDogaObject")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("MeccsDogaObject")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2023")]
|
||||
[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("b0483911-fd39-46e1-bda7-4773f1409664")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
|
@ -7,6 +7,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tombok1", "Tombok1\Tombok1.
|
|||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MeccsDoga", "MeccsDoga\MeccsDoga.csproj", "{022E0B9A-7125-4EC5-9A08-115025405518}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MeccsDogaObject", "MeccsDogaObject\MeccsDogaObject.csproj", "{B0483911-FD39-46E1-BDA7-4773F1409664}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
@ -21,6 +23,10 @@ Global
|
|||
{022E0B9A-7125-4EC5-9A08-115025405518}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{022E0B9A-7125-4EC5-9A08-115025405518}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{022E0B9A-7125-4EC5-9A08-115025405518}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{B0483911-FD39-46E1-BDA7-4773F1409664}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{B0483911-FD39-46E1-BDA7-4773F1409664}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{B0483911-FD39-46E1-BDA7-4773F1409664}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{B0483911-FD39-46E1-BDA7-4773F1409664}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
Loading…
Reference in New Issue
Block a user