This commit is contained in:
2022-06-09 09:54:49 +02:00
parent 1bdf50c864
commit c958775e1b
44 changed files with 6269 additions and 41 deletions

Binary file not shown.

View File

@@ -0,0 +1,20 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("SzigetUT")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SzigetUT")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("ad2126eb-7139-415b-aee6-cffe0c0ec592")]
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

74
SzigetUT/SzigetUT.csproj Normal file
View File

@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\MSTest.TestAdapter.2.2.7\build\net45\MSTest.TestAdapter.props" Condition="Exists('..\packages\MSTest.TestAdapter.2.2.7\build\net45\MSTest.TestAdapter.props')" />
<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>{AD2126EB-7139-415B-AEE6-CFFE0C0EC592}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SzigetUT</RootNamespace>
<AssemblyName>SzigetUT</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
<IsCodedUITest>False</IsCodedUITest>
<TestProjectType>UnitTest</TestProjectType>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<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' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\MSTest.TestFramework.2.2.7\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\MSTest.TestFramework.2.2.7\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
</ItemGroup>
<ItemGroup>
<Compile Include="UnitTest1.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Szigetek\Szigetek.csproj">
<Project>{81ea1bcf-48a1-4c1b-b6a9-23d49dc2e820}</Project>
<Name>Szigetek</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\MSTest.TestAdapter.2.2.7\build\net45\MSTest.TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.2.2.7\build\net45\MSTest.TestAdapter.props'))" />
<Error Condition="!Exists('..\packages\MSTest.TestAdapter.2.2.7\build\net45\MSTest.TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.2.2.7\build\net45\MSTest.TestAdapter.targets'))" />
</Target>
<Import Project="..\packages\MSTest.TestAdapter.2.2.7\build\net45\MSTest.TestAdapter.targets" Condition="Exists('..\packages\MSTest.TestAdapter.2.2.7\build\net45\MSTest.TestAdapter.targets')" />
</Project>

26
SzigetUT/UnitTest1.cs Normal file
View File

@@ -0,0 +1,26 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using Szigetek;
using System.IO;
namespace SzigetUT {
[TestClass]
public class UnitTest1 {
[TestMethod]
public void testSzam() {
StringReader sr = new StringReader("10101110");
Console.SetIn(sr);
Sziget.setSziget();
Assert.AreEqual(Sziget.vizsgalat()[0], 5);
}
[TestMethod]
public void testHossz() {
StringReader sr = new StringReader("10101110");
Console.SetIn(sr);
Sziget.setSziget();
Assert.AreEqual(Sziget.vizsgalat()[1], 3);
}
}
}

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

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>

Binary file not shown.

View File

@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]

View File

@@ -0,0 +1 @@
c4dbf5068faf095193374df06d0b950b719a7e04

View File

@@ -0,0 +1,18 @@
C:\dev\c#\c-sharp\SzigetUT\bin\Debug\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll
C:\dev\c#\c-sharp\SzigetUT\bin\Debug\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll
C:\dev\c#\c-sharp\SzigetUT\bin\Debug\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll
C:\dev\c#\c-sharp\SzigetUT\bin\Debug\Microsoft.TestPlatform.AdapterUtilities.dll
C:\dev\c#\c-sharp\SzigetUT\bin\Debug\SzigetUT.dll
C:\dev\c#\c-sharp\SzigetUT\bin\Debug\SzigetUT.pdb
C:\dev\c#\c-sharp\SzigetUT\bin\Debug\Microsoft.VisualStudio.TestPlatform.TestFramework.dll
C:\dev\c#\c-sharp\SzigetUT\bin\Debug\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll
C:\dev\c#\c-sharp\SzigetUT\bin\Debug\Szigetek.exe
C:\dev\c#\c-sharp\SzigetUT\bin\Debug\Szigetek.pdb
C:\dev\c#\c-sharp\SzigetUT\bin\Debug\Szigetek.exe.config
C:\dev\c#\c-sharp\SzigetUT\bin\Debug\Microsoft.VisualStudio.TestPlatform.TestFramework.xml
C:\dev\c#\c-sharp\SzigetUT\bin\Debug\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.xml
C:\dev\c#\c-sharp\SzigetUT\obj\Debug\SzigetUT.csproj.AssemblyReference.cache
C:\dev\c#\c-sharp\SzigetUT\obj\Debug\SzigetUT.csproj.CoreCompileInputs.cache
C:\dev\c#\c-sharp\SzigetUT\obj\Debug\SzigetUT.csproj.CopyComplete
C:\dev\c#\c-sharp\SzigetUT\obj\Debug\SzigetUT.dll
C:\dev\c#\c-sharp\SzigetUT\obj\Debug\SzigetUT.pdb

Binary file not shown.

Binary file not shown.

5
SzigetUT/packages.config Normal file
View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MSTest.TestAdapter" version="2.2.7" targetFramework="net48" />
<package id="MSTest.TestFramework" version="2.2.7" targetFramework="net48" />
</packages>

View File

@@ -2,48 +2,15 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
namespace Szigetek {
internal class Program {
static void Main(string[] args) {
int sziget_sorozat = 0;
int sziget_sorozat_max = 0;
int sziget_sum = 0;
int hely = -1;
string folytatas = "igen";
bool sorozat = false;
while (folytatas == "igen") {
Console.WriteLine("Sziget 1 | Tenger 0");
hely = Convert.ToInt32(Console.ReadLine());
if (hely == 1) {
sziget_sum++;
sorozat = true;
if (sorozat) {
sziget_sorozat++;
}
} else {
sorozat = false;
sziget_sorozat_max = sziget_sorozat;
sziget_sorozat = 0;
}
Console.WriteLine("Akarsz meg megadni adatot? (igen/nem)");
folytatas = Console.ReadLine();
if(folytatas != "igen") {
if (sziget_sorozat_max < sziget_sorozat) {
sziget_sorozat_max = sziget_sorozat;
}
}
}
Console.WriteLine("Szigetek szama: {0}", sziget_sum);
Console.WriteLine("Legtobb osszefuggo szigetek szama: {0}", sziget_sorozat_max);
Console.ReadKey();
public class Program {
public static void Main(string[] args) {
Sziget.setSziget();
Console.WriteLine("Szigetek szama: {0}", Sziget.vizsgalat()[0]);
Console.WriteLine("Legtobb osszefuggo szigetek szama: {0}", Sziget.vizsgalat()[1]);
Thread.Sleep(5000);
}
}
}

46
Szigetek/Sziget.cs Normal file
View File

@@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Szigetek {
public static class Sziget {
private static int sziget_sorozat = 0;
private static int sziget_sorozat_max = 0;
private static int sziget_sum = 0;
private static string sziget = "";
private static bool sorozat = false;
public static void setSziget() {
Console.WriteLine("Adja meg a szigeteket | sziget 1, tenger 0");
sziget = Console.ReadLine();
}
public static int[] vizsgalat() {
for (int i = 0; i < sziget.Length; i++) {
if (sziget[i].Equals('1')) {
sziget_sum++;
sorozat = true;
if (sorozat) {
sziget_sorozat++;
}
} else {
sorozat = false;
sziget_sorozat_max = sziget_sorozat;
sziget_sorozat = 0;
}
if (i == sziget.Length-1) {
if (sziget_sorozat_max < sziget_sorozat) {
sziget_sorozat_max = sziget_sorozat;
}
}
}
int[] tomb = { sziget_sum, sziget_sorozat_max };
return tomb;
}
}
}

View File

@@ -65,6 +65,7 @@
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Sziget.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />

Binary file not shown.

Binary file not shown.

View File

@@ -1 +1 @@
a716bfef2e809d656a083b5be6f3dfe2908c1bec
319464b1b6c248c74c5de68481425c8fa287ae96

Binary file not shown.

Binary file not shown.

View File

@@ -111,6 +111,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TermenyJoslas", "TermenyJos
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BMI", "BMI\BMI.csproj", "{119B48A5-5CB7-4C35-AADA-64EF85E66AA3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SzigetUT", "SzigetUT\SzigetUT.csproj", "{AD2126EB-7139-415B-AEE6-CFFE0C0EC592}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -551,6 +553,14 @@ Global
{119B48A5-5CB7-4C35-AADA-64EF85E66AA3}.Release|Any CPU.Build.0 = Release|Any CPU
{119B48A5-5CB7-4C35-AADA-64EF85E66AA3}.Release|x64.ActiveCfg = Release|Any CPU
{119B48A5-5CB7-4C35-AADA-64EF85E66AA3}.Release|x64.Build.0 = Release|Any CPU
{AD2126EB-7139-415B-AEE6-CFFE0C0EC592}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AD2126EB-7139-415B-AEE6-CFFE0C0EC592}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AD2126EB-7139-415B-AEE6-CFFE0C0EC592}.Debug|x64.ActiveCfg = Debug|Any CPU
{AD2126EB-7139-415B-AEE6-CFFE0C0EC592}.Debug|x64.Build.0 = Debug|Any CPU
{AD2126EB-7139-415B-AEE6-CFFE0C0EC592}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AD2126EB-7139-415B-AEE6-CFFE0C0EC592}.Release|Any CPU.Build.0 = Release|Any CPU
{AD2126EB-7139-415B-AEE6-CFFE0C0EC592}.Release|x64.ActiveCfg = Release|Any CPU
{AD2126EB-7139-415B-AEE6-CFFE0C0EC592}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE