<commit_before>﻿using System;
using System.Linq.Expressions;
using System.Text.RegularExpressions;

namespace EvalTask
{
	class EvalProgram
	{
		static void Main(string[] args)
		{
			string input = Console.In.ReadToEnd();
		    input = input.Replace("%", "*0.01");
            var matches = Regex.Matches(input, @"([0-9\.]*)[\s]*/[\s]*([0-9\.]*)");
		    //var str = Regex.Match(input, "([0-9.]*)[ ]{0,}/[ ]{0,}([0-9.]*)");
		    foreach (Match match in matches)
		    {
                bool skip = true;
		        bool isInt = true;
                foreach (var group in match.Groups)
		        {
                    if (skip)
                    {
                        skip = false;
                    }
                    else if (group.ToString().Contains("."))
                    {
                        isInt = false;
                    }
		        }
		        if (isInt)
		        {
		            input = Regex.Replace(input, match.Value, $"div({match.Groups[1]},{match.Groups[2]})");
		        }
		    }
            var calc = new Sprache.Calc.XtensibleCalculator();
            calc.RegisterFunction("sqrt", (a) => Math.Sqrt(a));
            calc.RegisterFunction("div", (a,b) => (int)(a /b));
            //calc.RegisterFunction("sqrt", Math.Sqrt);

            // using expressions
            var expr = calc.ParseExpression(input);
            var func = expr.Compile();
            Console.WriteLine(func().ToString().Replace(",", ".").Replace("бесконечность","Infinity"));
        }
    }
}
<commit_msg>Div added<commit_after>﻿using System;
using System.Linq.Expressions;
using System.Text.RegularExpressions;

namespace EvalTask
{
	class EvalProgram
	{
		static void Main(string[] args)
		{
			string input = Console.In.ReadToEnd();
		    input = input.Replace("%", "*0.01");
            var matches = Regex.Matches(input, @"([0-9\.]*)[\s]*/[\s]*([0-9\.]*)");
		    //var str = Regex.Match(input, "([0-9.]*)[ ]{0,}/[ ]{0,}([0-9.]*)");
		    foreach (Match match in matches)
		    {
                bool skip = true;
		        bool isInt = true;
                foreach (var group in match.Groups)
		        {
                    if (skip)
                    {
                        skip = false;
                    }
                    else if (group.ToString().Contains("."))
                    {
                        isInt = false;
                    }
		        }
		        if (isInt)
		        {
		            input = Regex.Replace(input, match.Value, $"div({match.Groups[1]},{match.Groups[2]})");
		        }
		    }
            var calc = new Sprache.Calc.XtensibleCalculator();
            calc.RegisterFunction("sqrt", (a) => Math.Sqrt(a));
            calc.RegisterFunction("div", (a,b) => (int)(a /b));
            // using expressions
            var expr = calc.ParseExpression(input);
            var func = expr.Compile();
            Console.WriteLine(func().ToString().Replace(",", ".").Replace("бесконечность","Infinity"));
		}
    }
}

{'fraction_non_alphanumeric': 0.16368950958103282, 'fraction_numerical': 0.00974342318934719, 'mean_word_length': 1.4194815396700706, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2713638', 'n_tokens_mistral': 963, 'n_tokens_neox': 873, 'n_words': 167}