codingtests/solutions/CodeChef/easy/HS08TEST/solve.php

13 lines
203 B
PHP
Raw Permalink Normal View History

2011-04-10 11:19:21 +00:00
<?php
while($s=explode(' ',trim(fgets(STDIN)))) {
if($s[1]%5) {
echo $s[1];
} else {
$new = round($s[1]-$s[1]-0.5,2);
if($new)
echo $new;
else
echo $s[1];
}
}