Compare commits
2 Commits
6e75567157
...
240cab6b3e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
240cab6b3e | ||
|
|
4d4f746b2b |
10
Valtozok/Input/Input.csproj
Normal file
10
Valtozok/Input/Input.csproj
Normal file
@@ -0,0 +1,10 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
23
Valtozok/Input/Program.cs
Normal file
23
Valtozok/Input/Program.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
namespace Input
|
||||
{
|
||||
internal class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Console.WriteLine("Felhasználói input");
|
||||
|
||||
Console.Write("Adja meg az első számot:");
|
||||
int szam1=Convert.ToInt32(Console.ReadLine());
|
||||
Console.Write("Adja meg a második számot:");
|
||||
int szam2=Convert.ToInt32(Console.ReadLine());
|
||||
|
||||
int osszeg = szam1 + szam2;
|
||||
Console.WriteLine($"Összeg:{osszeg}");
|
||||
int szorzat = szam1 * szam2;
|
||||
Console.WriteLine($"Szorzat:{szorzat}");
|
||||
double osztas =(double) szam1 / szam2;
|
||||
Console.WriteLine($"Hányados:{osztas}");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
4
Valtozok/Valtozok.slnx
Normal file
4
Valtozok/Valtozok.slnx
Normal file
@@ -0,0 +1,4 @@
|
||||
<Solution>
|
||||
<Project Path="Input/Input.csproj" Id="8ed1142f-6e8b-4cc4-9eda-f68279e4a89b" />
|
||||
<Project Path="Valtozok/Valtozok.csproj" />
|
||||
</Solution>
|
||||
55
Valtozok/Valtozok/Program.cs
Normal file
55
Valtozok/Valtozok/Program.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
namespace Valtozok
|
||||
{
|
||||
internal class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Console.WriteLine("11b asztali alkalmazások");
|
||||
int szam1 = 145;
|
||||
|
||||
uint szam2 = 120;
|
||||
|
||||
Console.WriteLine(szam1);
|
||||
|
||||
//byte típus
|
||||
byte kisSzam = 255;
|
||||
|
||||
Console.WriteLine(Convert.ToString(kisSzam,2).PadLeft(8,'0'));
|
||||
Console.WriteLine(Convert.ToString(szam1, 2).PadLeft(32, '0'));
|
||||
|
||||
//short
|
||||
short kozepes = 56;
|
||||
ushort masikKozepes = 45;
|
||||
|
||||
Console.WriteLine(ushort.MaxValue);
|
||||
Console.WriteLine(short.MaxValue);
|
||||
|
||||
Console.WriteLine($"Ushort max:{ushort.MaxValue},Short max:{short.MaxValue}");
|
||||
|
||||
long hosszu = 4353454356666546;
|
||||
ulong uhosszu = 3432423434242423234;
|
||||
|
||||
Console.WriteLine($"Long max:{long.MaxValue},Ulong max:{ulong.MaxValue}");
|
||||
|
||||
//Lebegőpontos számok (tört számok)
|
||||
float lebego1 = 67.123456789012345678901234567890f;
|
||||
double lebego2 = 67.123456789012345678901234567890;
|
||||
decimal decimalis = 67.123456789012345678901234567890m;
|
||||
|
||||
Console.WriteLine($"Float:{lebego1}");
|
||||
Console.WriteLine($"Double:{lebego2}");
|
||||
Console.WriteLine($"Decimal:{decimalis}");
|
||||
|
||||
//Szöveg
|
||||
string szoveg = "Valami, bármi, akármi";
|
||||
szoveg = "Csak valami";
|
||||
|
||||
//Logikai
|
||||
bool logikai = true;
|
||||
|
||||
//Karakter ,betű, szám, írásjel, vezérlő karakter
|
||||
char karakter = 'b';
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
10
Valtozok/Valtozok/Valtozok.csproj
Normal file
10
Valtozok/Valtozok/Valtozok.csproj
Normal file
@@ -0,0 +1,10 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user