@underbottom/

smart ATM

PHP (Legacy)

No description

fork
loading

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.5473401875226014","path":"main.php","file":{"path":"main.php","content":{"asEncoding":{"base64":"PD9waHAKCmVycm9yX3JlcG9ydGluZygtMSk7CgokYW1vdW50ID0gNjYwMDsKCiRiaWxscyA9IFsKICAgIDEwMCA9PiAwLAogICAgMjAwID0+IDMsCiAgICA1MDAgPT4gMSwKICAgIDEwMDAgPT4gMCwKICAgIDIwMDAgPT4gNCwKICAgIDUwMDAgPT4gMQpdOwoKCmZvciAoJGNvdW50NTAwMCA9IDA7ICRiaWxsc1s1MDAwXSA+PSAkY291bnQ1MDAwIDsgJGNvdW50NTAwMCsrKSB7CiAgICBmb3IgKCRjb3VudDIwMDAgPSAwOyAkYmlsbHNbMjAwMF0gPj0gJGNvdW50MjAwMCA7ICRjb3VudDIwMDArKykgewogICAgICAgIGZvciAoJGNvdW50MTAwMCA9IDA7ICRiaWxsc1sxMDAwXSA+PSAkY291bnQxMDAwIDsgJGNvdW50MTAwMCsrKSB7CiAgICAgICAgICAgIGZvciAoJGNvdW50NTAwID0gMDsgJGJpbGxzWzUwMF0gPj0gJGNvdW50NTAwIDsgJGNvdW50NTAwKyspIHsKICAgICAgICAgICAgICAgIGZvciAoJGNvdW50MjAwID0gMDsgJGJpbGxzWzIwMF0gPj0gJGNvdW50MjAwIDsgJGNvdW50MjAwKyspIHsKICAgICAgICAgICAgICAgICAgICBmb3IgKCRjb3VudDEwMCA9IDA7ICRiaWxsc1sxMDBdID49ICRjb3VudDEwMCA7ICRjb3VudDEwMCsrKSB7CiAgICAgICAgICAgICAgICAgICAgICAgaWYgKCRjb3VudDEwMCoxMDArJGNvdW50MjAwKjIwMCskY291bnQ1MDAqNTAwKyRjb3VudDEwMDAqMTAwMCskY291bnQyMDAwKjIwMDArJGNvdW50NTAwMCo1MDAwID09ICRhbW91bnQpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gItCS0YvQtNCw0YfQsCDQstC+0LfQvNC+0LbQvdCwLCDRh9C40YHQu9C+INC60YPQv9GO0YA6XG57JGNvdW50MTAwfXgxMDAgeyRjb3VudDIwMH14MjAwIHskY291bnQ1MDB9eDUwMCB7JGNvdW50MTAwMH14MTAwMCB7JGNvdW50MjAwMH14MjAwMCB7JGNvdW50NTAwMH14NTAwMFxuIjsKICAgICAgICAgICAgICAgICAgICAgICAgIGV4aXQoKTsKICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfQp9CgplY2hvICLQktGL0LTQsNGH0LAg0L3QtdCy0L7Qt9C80L7QttC90LA6INC90LXQtNC+0YHRgtCw0YLQvtGH0L3QviDQutGD0L/RjtGALlxuIjsKCgo/Pg=="},"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
30
31
32
33
34
35
36
37
<?php

error_reporting(-1);

$amount = 6600;

$bills = [
    100 => 0,
    200 => 3,
    500 => 1,
    1000 => 0,
    2000 => 4,
    5000 => 1
];


for ($count5000 = 0; $bills[5000] >= $count5000 ; $count5000++) {
    for ($count2000 = 0; $bills[2000] >= $count2000 ; $count2000++) {
        for ($count1000 = 0; $bills[1000] >= $count1000 ; $count1000++) {
            for ($count500 = 0; $bills[500] >= $count500 ; $count500++) {
                for ($count200 = 0; $bills[200] >= $count200 ; $count200++) {
                    for ($count100 = 0; $bills[100] >= $count100 ; $count100++) {
                       if ($count100*100+$count200*200+$count500*500+$count1000*1000+$count2000*2000+$count5000*5000 == $amount) {
                         echo "Выдача возможна, число купюр:\n{$count100}x100 {$count200}x200 {$count500}x500 {$count1000}x1000 {$count2000}x2000 {$count5000}x5000\n";
                         exit();
                       }
                    }
                }
            }
        }
    }
}

echo "Выдача невозможна: недостаточно купюр.\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