18.02.2016, 16:32
... just use a do while loop, also use constants and remove useless variables
PHP код:
stock stockname(param) {
const
mp = 4,
pp = 2
;
new
i
;
do {
param -= (++i * mp) + pp;
} while(0 < param);
return i;
}