Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Uwe Wienkop
Prog1_WS2018_19_Wienkop
Commits
4e9b343d
Commit
4e9b343d
authored
Oct 24, 2018
by
Uwe Wienkop
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mi, 24.10.
parent
17c77914
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
344 additions
and
5 deletions
+344
-5
01Pythagoras/Prog1_WS2018.sln
01Pythagoras/Prog1_WS2018.sln
+12
-0
02Ausgabeaufbereitungen/Program.cs
02Ausgabeaufbereitungen/Program.cs
+7
-0
03ArrayIntro/Program.cs
03ArrayIntro/Program.cs
+36
-5
03OperationenAufZahlen/03OperationenAufZahlen.csproj
03OperationenAufZahlen/03OperationenAufZahlen.csproj
+53
-0
03OperationenAufZahlen/App.config
03OperationenAufZahlen/App.config
+6
-0
03OperationenAufZahlen/Program.cs
03OperationenAufZahlen/Program.cs
+39
-0
03OperationenAufZahlen/Properties/AssemblyInfo.cs
03OperationenAufZahlen/Properties/AssemblyInfo.cs
+36
-0
03Sortieren2/03Sortieren2.csproj
03Sortieren2/03Sortieren2.csproj
+53
-0
03Sortieren2/App.config
03Sortieren2/App.config
+6
-0
03Sortieren2/Program.cs
03Sortieren2/Program.cs
+60
-0
03Sortieren2/Properties/AssemblyInfo.cs
03Sortieren2/Properties/AssemblyInfo.cs
+36
-0
No files found.
01Pythagoras/Prog1_WS2018.sln
View file @
4e9b343d
...
...
@@ -25,6 +25,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "02WeitereSchleifentypen", "
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "03ArrayIntro", "..\03ArrayIntro\03ArrayIntro.csproj", "{AE3AAF7B-4F70-4D11-B812-10D5D1976AFC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "03OperationenAufZahlen", "..\03OperationenAufZahlen\03OperationenAufZahlen.csproj", "{C7520C44-C9D8-4A43-886C-BB66E51FA288}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "03Sortieren2", "..\03Sortieren2\03Sortieren2.csproj", "{09903113-919E-4DE4-BAFB-CB70FB1BA1BD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
...
...
@@ -75,6 +79,14 @@ Global
{AE3AAF7B-4F70-4D11-B812-10D5D1976AFC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AE3AAF7B-4F70-4D11-B812-10D5D1976AFC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AE3AAF7B-4F70-4D11-B812-10D5D1976AFC}.Release|Any CPU.Build.0 = Release|Any CPU
{C7520C44-C9D8-4A43-886C-BB66E51FA288}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C7520C44-C9D8-4A43-886C-BB66E51FA288}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C7520C44-C9D8-4A43-886C-BB66E51FA288}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C7520C44-C9D8-4A43-886C-BB66E51FA288}.Release|Any CPU.Build.0 = Release|Any CPU
{09903113-919E-4DE4-BAFB-CB70FB1BA1BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{09903113-919E-4DE4-BAFB-CB70FB1BA1BD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{09903113-919E-4DE4-BAFB-CB70FB1BA1BD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{09903113-919E-4DE4-BAFB-CB70FB1BA1BD}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
...
...
02Ausgabeaufbereitungen/Program.cs
View file @
4e9b343d
...
...
@@ -18,6 +18,13 @@ namespace _02Ausgabeaufbereitungen
Console
.
WriteLine
(
$">
{
a
,
14
:
f2
}
<"
);
// dto, Ausgabe auf zwei Stellen runden
Console
.
WriteLine
(
$">
{
a
,
14
:
f3
}
<"
);
// dto, Ausgabe auf drei Stellen runden
int
anzTage
=
3
;
Console
.
WriteLine
(
"{0,-16} {1,14:f2}"
,
$"
{
anzTage
}
Tage"
,
89.50
);
Console
.
WriteLine
(
"{0,-16} {1,14:f2}"
,
"5 Personen"
,
79.50
);
int
laenge
=
15
;
string
format
=
"{0,"
+
laenge
+
":f2}"
;
Console
.
WriteLine
(
format
,
89.50
);
}
}
...
...
03ArrayIntro/Program.cs
View file @
4e9b343d
...
...
@@ -10,9 +10,11 @@ namespace _03ArrayIntro
{
static
void
Main
(
string
[]
args
)
{
int
[]
feld
=
{
10
,
15
,
3
,
22
,
44
,
55
,
99
,
37
,
42
,
41
,
45
,
33
,
25
};
//int[] feld = { 10, 15, 3, 22, 44, 55, 99, 37, 42, 41, 45, 33, 25 };
int
[]
feld
=
{
10
,
15
,
3
,
22
,
44
,
55
};
//int[] feld = { -1,-2,-3,-4,-5, -6 };
// Alle Feldelemente ausgeben
for
(
int
i
=
0
;
i
<
feld
.
Length
;
i
++)
{
Console
.
WriteLine
(
feld
[
i
]);
...
...
@@ -29,7 +31,7 @@ namespace _03ArrayIntro
summe
=
0
;
for
(
int
i
=
0
;
i
<
feld
.
Length
;
i
++)
summe
+=
feld
[
i
];
Console
.
WriteLine
(
$"Mittelwert =
{(
double
)
summe
/
(
double
)
feld
.
Length
}
"
);
Console
.
WriteLine
(
$"Mittelwert =
{(
double
)
summe
/
(
double
)
feld
.
Length
}
"
);
// Maximum der Feldelemente; Variante 1
int
max
=
int
.
MinValue
;
...
...
@@ -40,7 +42,8 @@ namespace _03ArrayIntro
}
Console
.
WriteLine
(
$"Maximum =
{
max
}
"
);
// Maximum der Feldelemente; Variante 2
// Maximum der Feldelemente; Variante 27
// Bitte diese Variante verwenden!
max
=
feld
[
0
];
for
(
int
i
=
1
;
i
<
feld
.
Length
;
i
++)
{
...
...
@@ -72,8 +75,8 @@ namespace _03ArrayIntro
Console
.
WriteLine
(
$"Maximum
{
feld
[
maxIndex
]}
an der Position
{
maxIndex
}
"
);
// Position des minimalen Werts
int
minIndex
=
0
;
for
(
int
i
=
1
;
i
<
feld
.
Length
;
i
++)
int
minIndex
=
1
;
for
(
int
i
=
minIndex
+
1
;
i
<
feld
.
Length
;
i
++)
{
if
(
feld
[
i
]
<
feld
[
minIndex
])
{
...
...
@@ -81,6 +84,34 @@ namespace _03ArrayIntro
}
}
Console
.
WriteLine
(
$"Minimum
{
feld
[
minIndex
]}
an der Position
{
minIndex
}
"
);
// Sortieren eines Feldes
for
(
int
i
=
0
;
i
<
feld
.
Length
;
i
++)
{
Console
.
Write
(
$"
{
feld
[
i
],
5
}
"
);
}
Console
.
WriteLine
();
for
(
int
j
=
0
;
j
<
feld
.
Length
-
1
;
j
++)
{
int
minIndex2
=
j
;
for
(
int
i
=
minIndex2
+
1
;
i
<
feld
.
Length
;
i
++)
{
if
(
feld
[
i
]
<
feld
[
minIndex2
])
minIndex2
=
i
;
}
//Console.WriteLine($"Minimum {feld[minIndex]} an der Position {minIndex2}");
if
(
minIndex2
!=
j
)
{
int
tmp
=
feld
[
j
];
feld
[
j
]
=
feld
[
minIndex2
];
feld
[
minIndex2
]
=
tmp
;
}
}
for
(
int
i
=
0
;
i
<
feld
.
Length
;
i
++)
{
Console
.
Write
(
$"
{
feld
[
i
],
5
}
"
);
}
Console
.
WriteLine
();
}
}
}
03OperationenAufZahlen/03OperationenAufZahlen.csproj
0 → 100644
View file @
4e9b343d
<?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>
{C7520C44-C9D8-4A43-886C-BB66E51FA288}
</ProjectGuid>
<OutputType>
Exe
</OutputType>
<RootNamespace>
_03OperationenAufZahlen
</RootNamespace>
<AssemblyName>
03OperationenAufZahlen
</AssemblyName>
<TargetFrameworkVersion>
v4.6.1
</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>
\ No newline at end of file
03OperationenAufZahlen/App.config
0 → 100644
View file @
4e9b343d
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
configuration
>
<
startup
>
<
supportedRuntime
version
=
"v4.0"
sku
=
".NETFramework,Version=v4.6.1"
/>
</
startup
>
</
configuration
>
\ No newline at end of file
03OperationenAufZahlen/Program.cs
0 → 100644
View file @
4e9b343d
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
_03OperationenAufZahlen
{
class
Program
{
static
void
Main
(
string
[]
args
)
{
// Quersumme
int
zahl
=
123456
;
int
letzteZiffer
;
int
quersumme
=
0
;
while
(
zahl
>
0
)
{
letzteZiffer
=
zahl
%
10
;
quersumme
+=
letzteZiffer
;
zahl
=
zahl
/
10
;
}
Console
.
WriteLine
(
$"Quersumme =
{
quersumme
}
"
);
// Konvertierung ins Binärsystem; Ausgabe in umgekehrter Reihenfolge
zahl
=
11
;
while
(
zahl
>
0
)
{
letzteZiffer
=
zahl
%
2
;
Console
.
Write
(
letzteZiffer
);
zahl
=
zahl
/
2
;
}
Console
.
WriteLine
();
}
}
}
03OperationenAufZahlen/Properties/AssemblyInfo.cs
0 → 100644
View file @
4e9b343d
using
System.Reflection
;
using
System.Runtime.CompilerServices
;
using
System.Runtime.InteropServices
;
// Allgemeine Informationen über eine Assembly werden über die folgenden
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
// die einer Assembly zugeordnet sind.
[
assembly
:
AssemblyTitle
(
"03OperationenAufZahlen"
)]
[
assembly
:
AssemblyDescription
(
""
)]
[
assembly
:
AssemblyConfiguration
(
""
)]
[
assembly
:
AssemblyCompany
(
""
)]
[
assembly
:
AssemblyProduct
(
"03OperationenAufZahlen"
)]
[
assembly
:
AssemblyCopyright
(
"Copyright © 2018"
)]
[
assembly
:
AssemblyTrademark
(
""
)]
[
assembly
:
AssemblyCulture
(
""
)]
// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly
// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von
// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen.
[
assembly
:
ComVisible
(
false
)]
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
[
assembly
:
Guid
(
"c7520c44-c9d8-4a43-886c-bb66e51fa288"
)]
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
//
// Hauptversion
// Nebenversion
// Buildnummer
// Revision
//
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[
assembly
:
AssemblyVersion
(
"1.0.0.0"
)]
[
assembly
:
AssemblyFileVersion
(
"1.0.0.0"
)]
03Sortieren2/03Sortieren2.csproj
0 → 100644
View file @
4e9b343d
<?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>
{09903113-919E-4DE4-BAFB-CB70FB1BA1BD}
</ProjectGuid>
<OutputType>
Exe
</OutputType>
<RootNamespace>
_03Sortieren2
</RootNamespace>
<AssemblyName>
03Sortieren2
</AssemblyName>
<TargetFrameworkVersion>
v4.6.1
</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>
\ No newline at end of file
03Sortieren2/App.config
0 → 100644
View file @
4e9b343d
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
configuration
>
<
startup
>
<
supportedRuntime
version
=
"v4.0"
sku
=
".NETFramework,Version=v4.6.1"
/>
</
startup
>
</
configuration
>
\ No newline at end of file
03Sortieren2/Program.cs
0 → 100644
View file @
4e9b343d
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
_03Sortieren2
{
class
Program
{
static
void
Main
(
string
[]
args
)
{
//int[] feld = { 10, 15, 3, 22, 44, 55 };
int
[]
feld
=
new
int
[
20
];
Random
wuerfel
=
new
Random
();
for
(
int
i
=
0
;
i
<
feld
.
Length
;
i
++)
{
//feld[i] = feld.Length - i;
feld
[
i
]
=
wuerfel
.
Next
(
0
,
100
);
}
// Sortieren eines Feldes
for
(
int
i
=
0
;
i
<
feld
.
Length
;
i
++)
{
Console
.
Write
(
$"
{
feld
[
i
],
5
}
"
);
}
Console
.
WriteLine
();
DateTime
t0
=
DateTime
.
Now
;
for
(
int
j
=
0
;
j
<
feld
.
Length
-
1
;
j
++)
{
int
minIndex
=
j
;
for
(
int
i
=
minIndex
+
1
;
i
<
feld
.
Length
;
i
++)
{
if
(
feld
[
i
]
<
feld
[
minIndex
])
minIndex
=
i
;
}
//Console.WriteLine($"Minimum {feld[minIndex]} an der Position {minIndex2}");
if
(
minIndex
!=
j
)
{
int
tmp
=
feld
[
j
];
feld
[
j
]
=
feld
[
minIndex
];
feld
[
minIndex
]
=
tmp
;
}
}
// Array.Sort(feld);
//Console.WriteLine((DateTime.Now-t0).TotalMilliseconds);
for
(
int
i
=
0
;
i
<
feld
.
Length
;
i
++)
{
Console
.
Write
(
$"
{
feld
[
i
],
5
}
"
);
}
Console
.
WriteLine
();
}
}
}
03Sortieren2/Properties/AssemblyInfo.cs
0 → 100644
View file @
4e9b343d
using
System.Reflection
;
using
System.Runtime.CompilerServices
;
using
System.Runtime.InteropServices
;
// Allgemeine Informationen über eine Assembly werden über die folgenden
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
// die einer Assembly zugeordnet sind.
[
assembly
:
AssemblyTitle
(
"03Sortieren2"
)]
[
assembly
:
AssemblyDescription
(
""
)]
[
assembly
:
AssemblyConfiguration
(
""
)]
[
assembly
:
AssemblyCompany
(
""
)]
[
assembly
:
AssemblyProduct
(
"03Sortieren2"
)]
[
assembly
:
AssemblyCopyright
(
"Copyright © 2018"
)]
[
assembly
:
AssemblyTrademark
(
""
)]
[
assembly
:
AssemblyCulture
(
""
)]
// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly
// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von
// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen.
[
assembly
:
ComVisible
(
false
)]
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
[
assembly
:
Guid
(
"09903113-919e-4de4-bafb-cb70fb1ba1bd"
)]
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
//
// Hauptversion
// Nebenversion
// Buildnummer
// Revision
//
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[
assembly
:
AssemblyVersion
(
"1.0.0.0"
)]
[
assembly
:
AssemblyFileVersion
(
"1.0.0.0"
)]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment