<?php
$dollars = 200 ;
$exchangeRate = 80.93 ;
$roubles = 10000 ;
function calkR( $r , $c ) {
$d = $r / $c ;
return $d ;
}
function calkD( $c , $d )
{
$r = $d * $c ;
return $r ;
}
echo "$dollars долларов можно
обменять на " . calkD( $dollars , $exchangeRate ) . " рублей" . "<br>" ;
echo "$roubles рублей можно
обменять на " . calkR( $roubles , $exchangeRate ) . " долларов" ;
$roubles = calkD( $dollars , $exchangeRate ) ;
$dollars = calkR( $roubles , $exchangeRate ) ;
echo "<p>" . "$dollars долларов можно обменять на $roubles рублей" . "</p>" ;
Cjw/cGhwCmVycm9yX3JlcG9ydGluZygtMSk7CgokZG9sbGFycyA9IDIwMDsKJGV4Y2hhbmdlUmF0ZSA9IDgwLjkzOwokcm91YmxlcyA9IDEwMDAwOwoKZnVuY3Rpb24gY2Fsa1IoJHIsICRjKXsKICAgICRkID0gJHIvJGM7CiAgICByZXR1cm4gJGQ7Cn0KCmZ1bmN0aW9uIGNhbGtEKCRjLCAkZCkKewogICAgJHIgPSAkZCAqICRjOwogICAgcmV0dXJuICRyOwp9CgoKZWNobyAiJGRvbGxhcnMg0LTQvtC70LvQsNGA0L7QsiDQvNC+0LbQvdC+CtC+0LHQvNC10L3Rj9GC0Ywg0L3QsCAiIC4gY2Fsa0QoJGRvbGxhcnMsICRleGNoYW5nZVJhdGUpIC4gIiDRgNGD0LHQu9C10LkiIC4gIjxicj4iOwoKZWNobyAiJHJvdWJsZXMg0YDRg9Cx0LvQtdC5INC80L7QttC90L4K0L7QsdC80LXQvdGP0YLRjCDQvdCwICIgLiBjYWxrUigkcm91YmxlcywgJGV4Y2hhbmdlUmF0ZSkgLiAiINC00L7Qu9C70LDRgNC+0LIiOwoKJHJvdWJsZXMgPSBjYWxrRCgkZG9sbGFycywgJGV4Y2hhbmdlUmF0ZSk7CiRkb2xsYXJzID0gY2Fsa1IoJHJvdWJsZXMsICRleGNoYW5nZVJhdGUpOwoKZWNobyAiPHA+IiAuICIkZG9sbGFycyDQtNC+0LvQu9Cw0YDQvtCyINC80L7QttC90L4g0L7QsdC80LXQvdGP0YLRjCDQvdCwICRyb3VibGVzINGA0YPQsdC70LXQuSIgLiAiPC9wPiI7