Vektorok feladat
This commit is contained in:
6
Sorozatok/App.config
Normal file
6
Sorozatok/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>
|
||||
14
Sorozatok/Program.cs
Normal file
14
Sorozatok/Program.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sorozatok {
|
||||
internal class Program {
|
||||
static void Main(string[] args) {
|
||||
Sorozat sorozat = new Sorozat();
|
||||
Console.ReadKey();
|
||||
}
|
||||
}
|
||||
}
|
||||
36
Sorozatok/Properties/AssemblyInfo.cs
Normal file
36
Sorozatok/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("Sorozatok")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Sorozatok")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2022")]
|
||||
[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("c04e7877-b737-4300-b572-6fb7385046f5")]
|
||||
|
||||
// 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")]
|
||||
53
Sorozatok/Sorozat.cs
Normal file
53
Sorozatok/Sorozat.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sorozatok {
|
||||
internal class Sorozat {
|
||||
private int[] szamok = new int[4];
|
||||
|
||||
public Sorozat() {
|
||||
Console.WriteLine("Adja meg a számokat");
|
||||
for (int i = 0; i < szamok.Length; i++) {
|
||||
szamok[i] = Convert.ToInt32(Console.ReadLine());
|
||||
}
|
||||
mertani_e();
|
||||
szamtani_e();
|
||||
}
|
||||
|
||||
public void mertani_e() {
|
||||
int elso_hanyados = szamok[szamok.Length - 1] / szamok[szamok.Length - 2];
|
||||
bool sorozat_e = true;
|
||||
for (int i = szamok.Length -1; i > 0; i--) {
|
||||
int akt_hanyados = szamok[i] / szamok[i - 1];
|
||||
if (akt_hanyados != elso_hanyados) {
|
||||
Console.WriteLine("A sorozat nem mértani!");
|
||||
sorozat_e = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (sorozat_e) {
|
||||
Console.WriteLine("A sorozat mértani!");
|
||||
}
|
||||
}
|
||||
|
||||
public void szamtani_e() {
|
||||
int elso_kulonbseg = szamok[szamok.Length - 1] - szamok[szamok.Length - 2];
|
||||
bool sorozat_e = true;
|
||||
for (int i = szamok.Length-1; i > 0; i--) {
|
||||
int akt_kulonbseg = szamok[i] - szamok[i - 1];
|
||||
if(akt_kulonbseg != elso_kulonbseg) {
|
||||
Console.WriteLine("A sorozat nem számtani!");
|
||||
sorozat_e = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (sorozat_e) {
|
||||
Console.WriteLine("A sorozat számtani!");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
54
Sorozatok/Sorozatok.csproj
Normal file
54
Sorozatok/Sorozatok.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>{C04E7877-B737-4300-B572-6FB7385046F5}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>Sorozatok</RootNamespace>
|
||||
<AssemblyName>Sorozatok</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" />
|
||||
<Compile Include="Sorozat.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
BIN
Sorozatok/bin/Debug/Sorozatok.exe
Normal file
BIN
Sorozatok/bin/Debug/Sorozatok.exe
Normal file
Binary file not shown.
6
Sorozatok/bin/Debug/Sorozatok.exe.config
Normal file
6
Sorozatok/bin/Debug/Sorozatok.exe.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>
|
||||
BIN
Sorozatok/bin/Debug/Sorozatok.pdb
Normal file
BIN
Sorozatok/bin/Debug/Sorozatok.pdb
Normal file
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")]
|
||||
Binary file not shown.
BIN
Sorozatok/obj/Debug/Sorozatok.csproj.AssemblyReference.cache
Normal file
BIN
Sorozatok/obj/Debug/Sorozatok.csproj.AssemblyReference.cache
Normal file
Binary file not shown.
@@ -0,0 +1 @@
|
||||
02800a11e146e40a09c69c80f85a14bab48400e5
|
||||
@@ -0,0 +1,8 @@
|
||||
C:\dev\c#\c-sharp\Sorozatok\bin\Debug\Sorozatok.exe.config
|
||||
C:\dev\c#\c-sharp\Sorozatok\bin\Debug\Sorozatok.exe
|
||||
C:\dev\c#\c-sharp\Sorozatok\bin\Debug\Sorozatok.pdb
|
||||
C:\dev\c#\c-sharp\Sorozatok\obj\Debug\Sorozatok.csproj.AssemblyReference.cache
|
||||
C:\dev\c#\c-sharp\Sorozatok\obj\Debug\Sorozatok.csproj.SuggestedBindingRedirects.cache
|
||||
C:\dev\c#\c-sharp\Sorozatok\obj\Debug\Sorozatok.csproj.CoreCompileInputs.cache
|
||||
C:\dev\c#\c-sharp\Sorozatok\obj\Debug\Sorozatok.exe
|
||||
C:\dev\c#\c-sharp\Sorozatok\obj\Debug\Sorozatok.pdb
|
||||
BIN
Sorozatok/obj/Debug/Sorozatok.exe
Normal file
BIN
Sorozatok/obj/Debug/Sorozatok.exe
Normal file
Binary file not shown.
BIN
Sorozatok/obj/Debug/Sorozatok.pdb
Normal file
BIN
Sorozatok/obj/Debug/Sorozatok.pdb
Normal file
Binary file not shown.
Reference in New Issue
Block a user