-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
47 lines (36 loc) · 1.04 KB
/
index.php
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
<?php
use Zhelonin\MyLog as ML;
use Zhelonin\ZheloninException;
use Zhelonin\Quadratic ;
/*
include "core/EquationInterface.php";
include "core/LogAbstract.php";
include "core/LogInterface.php";
include "Zhelonin/MyLog.php";
include "Zhelonin/Line.php";
include "Zhelonin/Quadratic.php";
include "Zhelonin/ZheloninException.php";
*/
ini_set("display_errors", 1);
error_reporting(-1);
require_once("vendor/autoload.php");
try {
MyLog::log('Program version: '.file_get_contents('version'));
$values = array();
for ($i = 1; $i < 4; $i++) {
echo "Введите " . $i . " аргумент: ";
$values[] = readline();
}
$va = $values[0];
$vb = $values[1];
$vc = $values[2];
MyLog::log("Введено уравнение " . $va . "x^2 + " . $vb . "x + " . $vc . " = 0");
$b = new Quadratic();
$x = $b->solve($va, $vb, $vc);
$str = implode(", ", $x);
MyLog::log("Корни уравнения: " . $str);
} catch (ZheloninException $e) {
MyLog::log($e->getMessage());
}
MyLog::write();
?>