Skip to content

Commit 98d5097

Browse files
committed
minerTask
1 parent 96e7d32 commit 98d5097

29 files changed

+493
-29
lines changed

AssociativeArrays/.idea/.idea.AssociativeArrays/.idea/contentModel.xml

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

AssociativeArrays/.idea/.idea.AssociativeArrays/.idea/workspace.xml

Lines changed: 137 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>netcoreapp3.1</TargetFramework>
6+
</PropertyGroup>
7+
8+
</Project>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
using System;
2+
using System.Collections.Generic;
3+
4+
namespace AMinerTask
5+
{
6+
class Program
7+
{
8+
static void Main(string[] args)
9+
{
10+
int counter = 0;
11+
Dictionary<string, int> resources = new Dictionary<string, int>();
12+
string resource = null;
13+
int quantity = 0;
14+
15+
while (true)
16+
{
17+
counter++;
18+
string input = Console.ReadLine();
19+
20+
if (input == "stop")
21+
{
22+
break;
23+
}
24+
25+
if (counter % 2 == 0)
26+
{
27+
quantity = int.Parse(input);
28+
}
29+
else
30+
{
31+
resource = input;
32+
quantity = 0;
33+
}
34+
35+
if (resources.ContainsKey(resource))
36+
{
37+
resources[resource] += quantity;
38+
}
39+
else
40+
{
41+
resources[resource] = quantity;
42+
}
43+
}
44+
45+
foreach (KeyValuePair<string, int> pair in resources)
46+
{
47+
Console.WriteLine($"{pair.Key} -> {pair.Value}");
48+
}
49+
}
50+
}
51+
}
Binary file not shown.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"runtimeTarget": {
3+
"name": ".NETCoreApp,Version=v3.1",
4+
"signature": ""
5+
},
6+
"compilationOptions": {},
7+
"targets": {
8+
".NETCoreApp,Version=v3.1": {
9+
"AMinerTask/1.0.0": {
10+
"runtime": {
11+
"AMinerTask.dll": {}
12+
}
13+
}
14+
}
15+
},
16+
"libraries": {
17+
"AMinerTask/1.0.0": {
18+
"type": "project",
19+
"serviceable": false,
20+
"sha512": ""
21+
}
22+
}
23+
}
Binary file not shown.
Binary file not shown.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"runtimeOptions": {
3+
"additionalProbingPaths": [
4+
"/home/ktopchiev/.dotnet/store/|arch|/|tfm|",
5+
"/home/ktopchiev/.nuget/packages"
6+
]
7+
}
8+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"runtimeOptions": {
3+
"tfm": "netcoreapp3.1",
4+
"framework": {
5+
"name": "Microsoft.NETCore.App",
6+
"version": "3.1.0"
7+
}
8+
}
9+
}

0 commit comments

Comments
 (0)