Advertisement
desislava_topuzakova

Untitled

Apr 25th, 2018
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. <?php
  2. $value = readline();
  3. $in = readline();
  4. $out= readline();
  5.  
  6.  
  7. if ($in == "USD") $value = $value * 1.79549;
  8. else if ($in == "EUR") $value = $value * 1.95583;
  9. else if ($in == "GBP") $value = $value * 2.53405;
  10.  
  11.  
  12. if ($out == "USD") $value = $value / 1.79549;
  13. else if ($out == "EUR") $value = $value / 1.95583;
  14. else if ($out == "GBP") $value = $value / 2.53405;
  15.  
  16.  
  17. printf("%.2f $out",$value);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement