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_WS2017_18_Wienkop
Commits
87bebc70
Commit
87bebc70
authored
Nov 07, 2017
by
Uwe Wienkop
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Weitere Stringfunktionen, Caesar-Codierung
parent
f9fc03e8
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
303 additions
and
8 deletions
+303
-8
Prog1_WS2017-18/05Character/Program.cs
Prog1_WS2017-18/05Character/Program.cs
+31
-8
Prog1_WS2017-18/05Felder/05Felder.csproj
Prog1_WS2017-18/05Felder/05Felder.csproj
+60
-0
Prog1_WS2017-18/05Felder/App.config
Prog1_WS2017-18/05Felder/App.config
+6
-0
Prog1_WS2017-18/05Felder/Program.cs
Prog1_WS2017-18/05Felder/Program.cs
+27
-0
Prog1_WS2017-18/05Felder/Properties/AssemblyInfo.cs
Prog1_WS2017-18/05Felder/Properties/AssemblyInfo.cs
+36
-0
Prog1_WS2017-18/05StringSpeed/05StringSpeed.csproj
Prog1_WS2017-18/05StringSpeed/05StringSpeed.csproj
+60
-0
Prog1_WS2017-18/05StringSpeed/App.config
Prog1_WS2017-18/05StringSpeed/App.config
+6
-0
Prog1_WS2017-18/05StringSpeed/Program.cs
Prog1_WS2017-18/05StringSpeed/Program.cs
+26
-0
Prog1_WS2017-18/05StringSpeed/Properties/AssemblyInfo.cs
Prog1_WS2017-18/05StringSpeed/Properties/AssemblyInfo.cs
+36
-0
Prog1_WS2017-18/Prog1_WS2017-18.sln
Prog1_WS2017-18/Prog1_WS2017-18.sln
+15
-0
No files found.
Prog1_WS2017-18/05Character/Program.cs
View file @
87bebc70
...
...
@@ -11,6 +11,7 @@ namespace _05Character
static
void
Main
(
string
[]
args
)
{
string
s
=
"Hallo Welt"
;
char
z
=
'A'
;
foreach
(
char
c
in
s
)
{
...
...
@@ -39,6 +40,16 @@ namespace _05Character
Console
.
WriteLine
(
$"Ist
{
s1
}
ein Palindrom =>
{
istPalindrom
(
s1
)}
"
);
Console
.
WriteLine
(
Reverse
(
"ABCD"
));
s
=
"Hallo Welt"
;
s
=
s
.
Substring
(
0
,
5
)
+
"*****"
+
s
.
Substring
(
6
);
Console
.
WriteLine
(
s
);
string
codiert
=
CaesarCodierung
(
"CAESAR AN SEINE LEGION: ANGRIFF AUF DIE GALLIER"
,
6
);
Console
.
WriteLine
(
codiert
);
for
(
int
i
=
-
1
;
i
>-
26
;
i
--)
{
Console
.
WriteLine
(
CaesarCodierung
(
codiert
,
i
));
}
}
static
int
CompareTo
(
string
s1
,
string
s2
)
...
...
@@ -67,15 +78,15 @@ namespace _05Character
return
-
1
;
// neg.Erg --> s1 < s2
}
static
string
ToUpper
(
string
s
)
static
string
ToUpper
(
string
zeichenkette
)
{
string
sErg
=
""
;
foreach
(
char
c
in
s
)
foreach
(
char
zeichen
in
zeichenkette
)
{
if
(
c
>=
'a'
&&
c
<=
'z'
)
sErg
+=
(
char
)
(
c
-
32
);
// (char) unbedingt notwendig, sonst
else
// werden die Zahlenwerte gespeichert
sErg
=
sErg
+
c
;
if
(
zeichen
>=
'a'
&&
zeichen
<=
'z'
)
// Für Kleinbuchstaben:
sErg
+=
(
char
)
(
zeichen
-
(
'a'
-
'A'
)
);
// (char) unbedingt notwendig, sonst
else
// werden die Zahlenwerte gespeichert
sErg
=
sErg
+
zeichen
;
// Alle anderen Zeichen einfach übernehmen
}
return
sErg
;
}
...
...
@@ -85,11 +96,23 @@ namespace _05Character
string
sErg
=
""
;
foreach
(
char
zeichen
in
zeichenkette
)
{
sErg
=
sErg
+
zeichen
;
sErg
=
zeichen
+
sErg
;
}
return
sErg
;
}
static
string
CaesarCodierung
(
string
zeichenkette
,
int
n
)
{
string
sErg
=
""
;
foreach
(
char
zeichen
in
zeichenkette
)
{
if
(
zeichen
>=
'A'
&&
zeichen
<=
'Z'
)
sErg
+=
(
char
)(((
zeichen
-
'A'
)
+
n
+
26
)
%
26
+
'A'
);
else
sErg
+=
zeichen
;
}
return
sErg
;
}
static
bool
istPalindrom
(
string
s
)
{
...
...
Prog1_WS2017-18/05Felder/05Felder.csproj
0 → 100644
View file @
87bebc70
<?xml version="1.0" encoding="utf-8"?>
<Project
ToolsVersion=
"14.0"
DefaultTargets=
"Build"
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>
{DF0C7E25-0F18-4AF4-AF3B-392B076CE690}
</ProjectGuid>
<OutputType>
Exe
</OutputType>
<AppDesignerFolder>
Properties
</AppDesignerFolder>
<RootNamespace>
_05Felder
</RootNamespace>
<AssemblyName>
05Felder
</AssemblyName>
<TargetFrameworkVersion>
v4.5.2
</TargetFrameworkVersion>
<FileAlignment>
512
</FileAlignment>
<AutoGenerateBindingRedirects>
true
</AutoGenerateBindingRedirects>
</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"
/>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
\ No newline at end of file
Prog1_WS2017-18/05Felder/App.config
0 → 100644
View file @
87bebc70
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
configuration
>
<
startup
>
<
supportedRuntime
version
=
"v4.0"
sku
=
".NETFramework,Version=v4.5.2"
/>
</
startup
>
</
configuration
>
\ No newline at end of file
Prog1_WS2017-18/05Felder/Program.cs
0 → 100644
View file @
87bebc70
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
_05Felder
{
class
Program
{
static
void
Main
(
string
[]
args
)
{
// int px0 = 20, py0 = 30;
int
[]
f
=
{
10
,
20
,
30
,
45
,
50
,
15
,
5
,
20
,
25
};
int
min
=
f
[
0
];
// FALSCH: min = 0;
foreach
(
int
item
in
f
)
{
if
(
item
<
min
)
min
=
item
;
}
Console
.
WriteLine
(
$"Das Minimum beträgt
{
min
}
"
);
}
}
}
Prog1_WS2017-18/05Felder/Properties/AssemblyInfo.cs
0 → 100644
View file @
87bebc70
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
(
"05Felder"
)]
[
assembly
:
AssemblyDescription
(
""
)]
[
assembly
:
AssemblyConfiguration
(
""
)]
[
assembly
:
AssemblyCompany
(
""
)]
[
assembly
:
AssemblyProduct
(
"05Felder"
)]
[
assembly
:
AssemblyCopyright
(
"Copyright © 2017"
)]
[
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
(
"df0c7e25-0f18-4af4-af3b-392b076ce690"
)]
// 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"
)]
Prog1_WS2017-18/05StringSpeed/05StringSpeed.csproj
0 → 100644
View file @
87bebc70
<?xml version="1.0" encoding="utf-8"?>
<Project
ToolsVersion=
"14.0"
DefaultTargets=
"Build"
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>
{4C41C810-73CE-44DF-9D1C-4A9CCD001F10}
</ProjectGuid>
<OutputType>
Exe
</OutputType>
<AppDesignerFolder>
Properties
</AppDesignerFolder>
<RootNamespace>
_05StringSpeed
</RootNamespace>
<AssemblyName>
05StringSpeed
</AssemblyName>
<TargetFrameworkVersion>
v4.5.2
</TargetFrameworkVersion>
<FileAlignment>
512
</FileAlignment>
<AutoGenerateBindingRedirects>
true
</AutoGenerateBindingRedirects>
</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"
/>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
\ No newline at end of file
Prog1_WS2017-18/05StringSpeed/App.config
0 → 100644
View file @
87bebc70
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
configuration
>
<
startup
>
<
supportedRuntime
version
=
"v4.0"
sku
=
".NETFramework,Version=v4.5.2"
/>
</
startup
>
</
configuration
>
\ No newline at end of file
Prog1_WS2017-18/05StringSpeed/Program.cs
0 → 100644
View file @
87bebc70
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
_05StringSpeed
{
class
Program
{
static
void
Main
(
string
[]
args
)
{
string
sErg
=
""
;
StringBuilder
sb
=
new
StringBuilder
(
""
);
DateTime
t0
=
DateTime
.
Now
;
// Aktuelle Uhrzeit speichern
for
(
int
i
=
0
;
i
<
5000000
;
i
++)
{
//sErg = sErg + '.';
sb
.
Append
(
'.'
);
}
Console
.
WriteLine
((
DateTime
.
Now
-
t0
).
TotalMilliseconds
);
// Von der jetzigen Uhrzeit die Startzeit abziehen
// Console.WriteLine(sErg);
}
}
}
Prog1_WS2017-18/05StringSpeed/Properties/AssemblyInfo.cs
0 → 100644
View file @
87bebc70
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
(
"05StringSpeed"
)]
[
assembly
:
AssemblyDescription
(
""
)]
[
assembly
:
AssemblyConfiguration
(
""
)]
[
assembly
:
AssemblyCompany
(
""
)]
[
assembly
:
AssemblyProduct
(
"05StringSpeed"
)]
[
assembly
:
AssemblyCopyright
(
"Copyright © 2017"
)]
[
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
(
"4c41c810-73ce-44df-9d1c-4a9ccd001f10"
)]
// 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"
)]
Prog1_WS2017-18/Prog1_WS2017-18.sln
View file @
87bebc70
...
...
@@ -42,6 +42,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "04Praktikumstipps", "04Prak
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "05Character", "05Character\05Character.csproj", "{BCEB94CF-A8DE-4E6B-95EE-360E3933825D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "05StringSpeed", "05StringSpeed\05StringSpeed.csproj", "{4C41C810-73CE-44DF-9D1C-4A9CCD001F10}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "05Felder", "05Felder\05Felder.csproj", "{DF0C7E25-0F18-4AF4-AF3B-392B076CE690}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
...
...
@@ -116,8 +120,19 @@ Global
{BCEB94CF-A8DE-4E6B-95EE-360E3933825D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BCEB94CF-A8DE-4E6B-95EE-360E3933825D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BCEB94CF-A8DE-4E6B-95EE-360E3933825D}.Release|Any CPU.Build.0 = Release|Any CPU
{4C41C810-73CE-44DF-9D1C-4A9CCD001F10}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4C41C810-73CE-44DF-9D1C-4A9CCD001F10}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4C41C810-73CE-44DF-9D1C-4A9CCD001F10}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4C41C810-73CE-44DF-9D1C-4A9CCD001F10}.Release|Any CPU.Build.0 = Release|Any CPU
{DF0C7E25-0F18-4AF4-AF3B-392B076CE690}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DF0C7E25-0F18-4AF4-AF3B-392B076CE690}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DF0C7E25-0F18-4AF4-AF3B-392B076CE690}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DF0C7E25-0F18-4AF4-AF3B-392B076CE690}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{DF0C7E25-0F18-4AF4-AF3B-392B076CE690} = {DD66E463-4183-46B2-A475-A587C445E359}
EndGlobalSection
EndGlobal
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