New Year
This commit is contained in:
parent
905305ef0d
commit
c00065c1bc
13 changed files with 176 additions and 7 deletions
16
Emne 3/Debug1/Debug1.sln
Normal file
16
Emne 3/Debug1/Debug1.sln
Normal file
|
@ -0,0 +1,16 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Debug1", "Debug1\Debug1.csproj", "{9A30B79C-FF6E-40AC-AE3C-BB49F525540F}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{9A30B79C-FF6E-40AC-AE3C-BB49F525540F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{9A30B79C-FF6E-40AC-AE3C-BB49F525540F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{9A30B79C-FF6E-40AC-AE3C-BB49F525540F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{9A30B79C-FF6E-40AC-AE3C-BB49F525540F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
10
Emne 3/Debug1/Debug1/Debug1.csproj
Normal file
10
Emne 3/Debug1/Debug1/Debug1.csproj
Normal file
|
@ -0,0 +1,10 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
21
Emne 3/Debug1/Debug1/Program.cs
Normal file
21
Emne 3/Debug1/Debug1/Program.cs
Normal file
|
@ -0,0 +1,21 @@
|
|||
var range = 250;
|
||||
|
||||
var counts = new int[range];
|
||||
string text = "something";
|
||||
while (!string.IsNullOrWhiteSpace(text))
|
||||
{
|
||||
text = Console.ReadLine();
|
||||
foreach (var character in text ?? string.Empty )
|
||||
{
|
||||
counts[(int)character]++;
|
||||
}
|
||||
|
||||
for (var i = 0; i < range; i++)
|
||||
{
|
||||
if (counts[i] > 0)
|
||||
{
|
||||
var character = (char)i;
|
||||
Console.WriteLine(character + " - " + counts[i]);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue