<?php
$input = '243+6743-78*2=';
$number = 0;
$result = 0;
$op = '';
for ($i = 0; $i < $inputLength; $i++){
if ($char == '+' || $char == '-' || $char == '=' || $char == '*') {
if ($op == '') {
$result = $number;
} elseif ($char == '=') {
echo $result;
}
$op = $char;
$number = 0;
$number = $number*10 + $char;
} else {
echo "Неверный символ: '$char'\n";
}
}
?>
PD9waHAKCmVycm9yX3JlcG9ydGluZygtMSk7Cm1iX2ludGVybmFsX2VuY29kaW5nKCd1dGYtOCcpOwoKJGlucHV0ID0gJzI0Mys2NzQzLTc4KjI9JzsKJGlucHV0TGVuZ3RoID0gbWJfc3RybGVuKCRpbnB1dCk7CgokbnVtYmVyID0gMDsKJHJlc3VsdCA9IDA7CiRvcCA9ICcnOwoKZm9yICgkaSA9IDA7ICRpIDwgJGlucHV0TGVuZ3RoOyAkaSsrKXsKCQoJJGNoYXIgPSBtYl9zdWJzdHIoJGlucHV0LCAkaSwgMSk7CglpZiAoJGNoYXIgPT0gJysnIHx8ICRjaGFyID09ICctJyB8fCAkY2hhciA9PSAnPScgfHwgJGNoYXIgPT0gJyonKSB7CgkJaWYgKCRvcCA9PSAnJykgewoJCQkkcmVzdWx0ID0gJG51bWJlcjsKCQl9IGVsc2VpZiAoJGNoYXIgPT0gJz0nKSB7CgkJCWVjaG8gJHJlc3VsdDsKCQkJZXhpdCgpOwoJCX0KCQkkb3AgPSAkY2hhcjsKCQkkbnVtYmVyID0gMDsKCX0gZWxzZWlmIChpc19udW1lcmljKCRjaGFyKSkgewoJCSRjaGFyID0gaW50dmFsKCRjaGFyKTsKCQkkbnVtYmVyID0gJG51bWJlcioxMCArICRjaGFyOwoJfSBlbHNlIHsKCQllY2hvICLQndC10LLQtdGA0L3Ri9C5INGB0LjQvNCy0L7QuzogJyRjaGFyJ1xuIjsKCX0KfQoKPz4=