@underbottom/

value credit

PHP (Legacy)

No description

fork
loading

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.9983568242085334","path":"main.php","file":{"path":"main.php","content":{"asEncoding":{"base64":"PD9waHAKIAplcnJvcl9yZXBvcnRpbmcoLTEpOwoKZnVuY3Rpb24gY291bnRQZXJjZW50KCRhbW91bnREZWJ0LCRwZXJjZW50LCRjb21taXNzaW9uLCRiYW5rTmFtZSkgewogICRyZXN1bHQgWzBdID0gMDsKICAkcGF5bWVudCA9IDUwMDA7CiAgZm9yICgkaT0xOzA8JGFtb3VudERlYnQ7JGkrKykgewogICAgJGFtb3VudERlYnQ9JGFtb3VudERlYnQqJHBlcmNlbnQrJGNvbW1pc3Npb247CiAgICAkcmVzdWx0WzBdICs9IG1pbiAoJGFtb3VudERlYnQsICRwYXltZW50KTsKICAgICRhbW91bnREZWJ0IC09ICRwYXltZW50OyAKICB9CgogICRyZXN1bHQgWzFdID0gJGk7CiAgJHJlc3VsdCBbMl0gPSAkYmFua05hbWU7CgogIHJldHVybiAkcmVzdWx0Owp9CiAKCiRob21vID0gY291bnRQZXJjZW50KDQwMDAwLDEuMDQsNTAwLCJIb21vY3JlZGl0Iik7CiRzb2Z0ID0gY291bnRQZXJjZW50KDQwMDAwLDEuMDMsMTAwMCwiU29mdGJhbmsiKTsKJGJhbmsgPSBjb3VudFBlcmNlbnQoNDc3NzcsMS4wMiwwLCJTdHJhd2JlcnJ5QmFuayIpOwoKJHRvdGFsUmVzdWx0ID0gbWluICgkaG9tbywkc29mdCwkYmFuayk7CgplY2hvICLQodCw0LzRi9C5INCy0YvQs9C+0LTQvdGL0Lkg0LHQsNC90Lo6IHskdG90YWxSZXN1bHRbMl19XG7QoNC10LDQu9GM0L3QsNGPINGG0LXQvdCwINCw0LnQv9Cw0LTQsDogeyR0b3RhbFJlc3VsdFswXX1cbtCS0YDQtdC80Y8g0LLRi9C/0LvQsNGC0Ys6IHskdG90YWxSZXN1bHRbMV19INC80LXRgdGP0YbQtdCyLlxuIjsKCj8+"},"asBuffer":null},"loaded":true}}
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
<?php
 
error_reporting(-1);

function countPercent($amountDebt,$percent,$commission,$bankName) {
  $result [0] = 0;
  $payment = 5000;
  for ($i=1;0<$amountDebt;$i++) {
    $amountDebt=$amountDebt*$percent+$commission;
    $result[0] += min ($amountDebt, $payment);
    $amountDebt -= $payment; 
  }

  $result [1] = $i;
  $result [2] = $bankName;

  return $result;
}
 

$homo = countPercent(40000,1.04,500,"Homocredit");
$soft = countPercent(40000,1.03,1000,"Softbank");
$bank = countPercent(47777,1.02,0,"StrawberryBank");

$totalResult = min ($homo,$soft,$bank);

echo "Самый выгодный банк: {$totalResult[2]}\nРеальная цена айпада: {$totalResult[0]}\nВремя выплаты: {$totalResult[1]} месяцев.\n";

?>
PHP 7.0.8 (Legacy: use the following for new features: Command-line PHP: https://repl.it/languages/php_cli PHP Web Server: https://repl.it/languages/php7