-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
58 lines (46 loc) · 1.48 KB
/
Program.cs
File metadata and controls
58 lines (46 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace Calculator
{
class Program
{
private static string SourceString;
private static Stack<int> Ints = new Stack<int>();
private static Stack<Dictionary<char, int>> Chars = new Stack<Dictionary<char, int>>();
private static void Parse(string PString)
{
foreach (char Current in PString)
{
if (Priorities.Keys.Contains(Current))
{
// Chars.Push(new Dictionary<char, int>(Current,));
}
else if (Enumerable.Range(0, 10).Contains(int.Parse(Current.ToString())))
{
Ints.Push(int.Parse(Current.ToString()));
}
}
}
private static Dictionary<char, int> Priorities;
static public void InitPriorities()
{
Priorities = new Dictionary<char, int>();
Priorities.Add('(', 1); //TODO
Priorities.Add(')', 1); //TODO
Priorities.Add('-', 1);
Priorities.Add('+', 1);
Priorities.Add('/', 2);
Priorities.Add('*', 2);
}
static void Main(string[] args)
{
Console.WriteLine(Directory.GetCurrentDirectory());
InitPriorities();
//input
Console.WriteLine("Input");
SourceString = Console.ReadLine();
}
}
}