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
1543bd39
Commit
1543bd39
authored
Nov 06, 2018
by
Uwe Wienkop
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Di, 6.11.2018
parent
a72bbbd1
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
342 additions
and
0 deletions
+342
-0
01Pythagoras/Prog1_WS2018.sln
01Pythagoras/Prog1_WS2018.sln
+12
-0
05ZeichenkettenIntro/05ZeichenkettenIntro.csproj
05ZeichenkettenIntro/05ZeichenkettenIntro.csproj
+53
-0
05ZeichenkettenIntro/App.config
05ZeichenkettenIntro/App.config
+6
-0
05ZeichenkettenIntro/Program.cs
05ZeichenkettenIntro/Program.cs
+52
-0
05ZeichenkettenIntro/Properties/AssemblyInfo.cs
05ZeichenkettenIntro/Properties/AssemblyInfo.cs
+36
-0
05ZeichenkettenIntro02/05ZeichenkettenIntro02.csproj
05ZeichenkettenIntro02/05ZeichenkettenIntro02.csproj
+53
-0
05ZeichenkettenIntro02/App.config
05ZeichenkettenIntro02/App.config
+6
-0
05ZeichenkettenIntro02/Program.cs
05ZeichenkettenIntro02/Program.cs
+88
-0
05ZeichenkettenIntro02/Properties/AssemblyInfo.cs
05ZeichenkettenIntro02/Properties/AssemblyInfo.cs
+36
-0
No files found.
01Pythagoras/Prog1_WS2018.sln
View file @
1543bd39
...
...
@@ -43,6 +43,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "04Funktionen_04_Fakultaet",
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "04Funktionen_05_Params", "04Funktionen_05_Params\04Funktionen_05_Params.csproj", "{FC1F0780-9175-48B6-AE52-ADD91352B92B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "05ZeichenkettenIntro", "..\05ZeichenkettenIntro\05ZeichenkettenIntro.csproj", "{291953D3-7F87-4315-AA05-2C9466C76FF7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "05ZeichenkettenIntro02", "..\05ZeichenkettenIntro02\05ZeichenkettenIntro02.csproj", "{4D83143C-15A2-4E57-AA87-F848879BB1AB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
...
...
@@ -129,6 +133,14 @@ Global
{FC1F0780-9175-48B6-AE52-ADD91352B92B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FC1F0780-9175-48B6-AE52-ADD91352B92B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FC1F0780-9175-48B6-AE52-ADD91352B92B}.Release|Any CPU.Build.0 = Release|Any CPU
{291953D3-7F87-4315-AA05-2C9466C76FF7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{291953D3-7F87-4315-AA05-2C9466C76FF7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{291953D3-7F87-4315-AA05-2C9466C76FF7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{291953D3-7F87-4315-AA05-2C9466C76FF7}.Release|Any CPU.Build.0 = Release|Any CPU
{4D83143C-15A2-4E57-AA87-F848879BB1AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4D83143C-15A2-4E57-AA87-F848879BB1AB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4D83143C-15A2-4E57-AA87-F848879BB1AB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4D83143C-15A2-4E57-AA87-F848879BB1AB}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
...
...
05ZeichenkettenIntro/05ZeichenkettenIntro.csproj
0 → 100644
View file @
1543bd39
<?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>
{291953D3-7F87-4315-AA05-2C9466C76FF7}
</ProjectGuid>
<OutputType>
Exe
</OutputType>
<RootNamespace>
_05ZeichenkettenIntro
</RootNamespace>
<AssemblyName>
05ZeichenkettenIntro
</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
05ZeichenkettenIntro/App.config
0 → 100644
View file @
1543bd39
<?
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
05ZeichenkettenIntro/Program.cs
0 → 100644
View file @
1543bd39
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
_05ZeichenkettenIntro
{
class
Program
{
static
void
Main
(
string
[]
args
)
{
// string s = Console.ReadLine();
string
s
=
"Hallo"
;
// string ~ Zeichenkette
// d.h. ein Feld von Zeichen
for
(
int
i
=
0
;
i
<
s
.
Length
;
i
++)
{
char
c
=
s
[
i
];
Console
.
WriteLine
(
c
);
// s[i] = "X"; -- geht nicht, da die Zeichen eines
// strings read-only sind
}
s
=
"Ein ganz langer Text"
;
string
[]
woerter
=
s
.
Split
(
' '
);
// s.Split ~ Es wird die Methode Split der Klasse string aufgerufen
// Spaltet den String s in einzelne Wörter auf
for
(
int
i
=
0
;
i
<
woerter
.
Length
;
i
++)
{
Console
.
WriteLine
(
woerter
[
i
]);
}
string
s2
=
"Hallo"
+
" Welt"
+
" Wir sind da!"
;
string
s3
=
""
;
StringBuilder
sb
=
new
StringBuilder
(
500000
);
DateTime
t0
=
DateTime
.
Now
;
for
(
int
i
=
0
;
i
<
400000
;
i
++)
{
// s3 += '.';
sb
.
Append
(
'.'
);
}
Console
.
WriteLine
(
$"Fertig,
{(
DateTime
.
Now
-
t0
).
TotalMilliseconds
}
ms"
);
//Console.WriteLine(s3);
//Console.WriteLine(sb);
string
s4
=
sb
.
ToString
();
}
}
}
05ZeichenkettenIntro/Properties/AssemblyInfo.cs
0 → 100644
View file @
1543bd39
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
(
"05ZeichenkettenIntro"
)]
[
assembly
:
AssemblyDescription
(
""
)]
[
assembly
:
AssemblyConfiguration
(
""
)]
[
assembly
:
AssemblyCompany
(
""
)]
[
assembly
:
AssemblyProduct
(
"05ZeichenkettenIntro"
)]
[
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
(
"291953d3-7f87-4315-aa05-2c9466c76ff7"
)]
// 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"
)]
05ZeichenkettenIntro02/05ZeichenkettenIntro02.csproj
0 → 100644
View file @
1543bd39
<?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>
{4D83143C-15A2-4E57-AA87-F848879BB1AB}
</ProjectGuid>
<OutputType>
Exe
</OutputType>
<RootNamespace>
_05ZeichenkettenIntro02
</RootNamespace>
<AssemblyName>
05ZeichenkettenIntro02
</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
05ZeichenkettenIntro02/App.config
0 → 100644
View file @
1543bd39
<?
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
05ZeichenkettenIntro02/Program.cs
0 → 100644
View file @
1543bd39
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
_05ZeichenkettenIntro02
{
class
Program
{
static
void
Main
(
string
[]
args
)
{
string
s
=
"1234567890"
;
//string s = Console.ReadLine();
//for (int i = 0; i < s.Length; i++)
//{
// char c = s[i];
//}
foreach
(
char
c
in
s
)
{
int
x
=
c
;
Console
.
WriteLine
(
$"
{
c
}
--
{
x
}
"
);
}
// int k = Convert.ToInt32(s);
int
k
=
MyConvertToInt32
(
"10011"
,
2
);
Console
.
WriteLine
(
k
);
Console
.
WriteLine
(
MyToUpper
(
"Hallo Welt"
));
int
[]
anzahlen
=
MyHisto
(
"Hallo"
);
for
(
int
i
=
0
;
i
<
26
;
i
++)
{
Console
.
WriteLine
(
$"
{(
char
)(
i
+
'A'
)}
--
{
anzahlen
[
i
]}
"
);
}
}
// 0 1 2 3 4 5 6
// 48 49 50 51 52 53 54
static
int
MyConvertToInt32
(
string
s
,
int
basis
)
{
int
zahl
=
0
;
// 123
int
faktor
=
1
;
for
(
int
i
=
s
.
Length
-
1
;
i
>=
0
;
i
--)
{
zahl
+=
(
s
[
i
]
-
'0'
)
*
faktor
;
// -'0' ~ - 48
// d.h. aus einer ASCII '0' wird eine int 0
faktor
*=
basis
;
}
return
zahl
;
}
static
string
MyToUpper
(
string
s
)
{
string
erg
=
""
;
foreach
(
char
z
in
s
)
{
if
(
z
>=
'a'
&&
z
<=
'z'
)
erg
+=
(
char
)(
z
-
(
'a'
-
'A'
));
// (char) - cast ist erforderlich, da sonst
// der Int-Wert dem erg-String hinzugefügt wird
else
erg
+=
z
;
}
return
erg
;
}
static
int
[]
MyHisto
(
string
s
)
{
int
[]
anz
=
new
int
[
26
];
foreach
(
char
z
in
s
)
{
if
(
z
>=
'a'
&&
z
<=
'z'
)
{
int
buchstabennummer
=
z
-
'a'
;
anz
[
buchstabennummer
]++;
}
else
if
(
z
>=
'A'
&&
z
<=
'Z'
)
anz
[
z
-
'A'
]++;
}
return
anz
;
}
static
void
Primzahlen
(
int
von
,
int
bis
)
{
if
(
von
<
2
||
bis
<
2
||
von
>
bis
)
throw
new
ArgumentOutOfRangeException
(
"Die Parameter der Funktion passen nicht!"
);
// ab hier "unbeschwert" weiter programmieren
}
}
}
05ZeichenkettenIntro02/Properties/AssemblyInfo.cs
0 → 100644
View file @
1543bd39
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
(
"05ZeichenkettenIntro02"
)]
[
assembly
:
AssemblyDescription
(
""
)]
[
assembly
:
AssemblyConfiguration
(
""
)]
[
assembly
:
AssemblyCompany
(
""
)]
[
assembly
:
AssemblyProduct
(
"05ZeichenkettenIntro02"
)]
[
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
(
"4d83143c-15a2-4e57-aa87-f848879bb1ab"
)]
// 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