Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $team = readline();
- $souvenirs_type = readline();
- $souvenirs_count = intval(readline());
- if ($team === 'Argentina' && $souvenirs_type === 'flags'){
- $souvenir_price = 3.25;
- $total_souvenirs_price = $souvenir_price * $souvenirs_count;
- echo "Pepi bought $souvenirs_count $souvenirs_type of $team for " . number_format($total_souvenirs_price, 2, '.', '') . " lv.";
- }else if ($team === 'Argentina' && $souvenirs_type === 'caps'){
- $souvenir_price = 7.2;
- $total_souvenirs_price = $souvenir_price * $souvenirs_count;
- echo "Pepi bought $souvenirs_count $souvenirs_type of $team for " . number_format($total_souvenirs_price, 2, '.', '') . " lv.";
- }else if ($team === 'Argentina' && $souvenirs_type === 'posters'){
- $souvenir_price = 5.1;
- $total_souvenirs_price = $souvenir_price * $souvenirs_count;
- echo "Pepi bought $souvenirs_count $souvenirs_type of $team for " . number_format($total_souvenirs_price, 2, '.', '') . " lv.";
- }else if ($team === 'Argentina' && $souvenirs_type === 'stickers'){
- $souvenir_price = 1.25;
- $total_souvenirs_price = $souvenir_price * $souvenirs_count;
- echo "Pepi bought $souvenirs_count $souvenirs_type of $team for " . number_format($total_souvenirs_price, 2, '.', '') . " lv.";
- }else if ($team === 'Brazil' && $souvenirs_type === 'flags'){
- $souvenir_price = 4.2;
- $total_souvenirs_price = $souvenir_price * $souvenirs_count;
- echo "Pepi bought $souvenirs_count $souvenirs_type of $team for " . number_format($total_souvenirs_price, 2, '.', '') . " lv.";
- }else if ($team === 'Brazil' && $souvenirs_type === 'caps'){
- $souvenir_price = 8.5;
- $total_souvenirs_price = $souvenir_price * $souvenirs_count;
- echo "Pepi bought $souvenirs_count $souvenirs_type of $team for " . number_format($total_souvenirs_price, 2, '.', '') . " lv.";
- }else if ($team === 'Brazil' && $souvenirs_type === 'posters'){
- $souvenir_price = 5.35;
- $total_souvenirs_price = $souvenir_price * $souvenirs_count;
- echo "Pepi bought $souvenirs_count $souvenirs_type of $team for " . number_format($total_souvenirs_price, 2, '.', '') . " lv.";
- }else if ($team === 'Brazil' && $souvenirs_type === 'stickers'){
- $souvenir_price = 1.2;
- $total_souvenirs_price = $souvenir_price * $souvenirs_count;
- echo "Pepi bought $souvenirs_count $souvenirs_type of $team for " . number_format($total_souvenirs_price, 2, '.', '') . " lv.";
- }else if ($team === 'Croatia' && $souvenirs_type === 'flags'){
- $souvenir_price = 2.75;
- $total_souvenirs_price = $souvenir_price * $souvenirs_count;
- echo "Pepi bought $souvenirs_count $souvenirs_type of $team for " . number_format($total_souvenirs_price, 2, '.', '') . " lv.";
- }else if ($team === 'Croatia' && $souvenirs_type === 'caps'){
- $souvenir_price = 6.9;
- $total_souvenirs_price = $souvenir_price * $souvenirs_count;
- echo "Pepi bought $souvenirs_count $souvenirs_type of $team for " . number_format($total_souvenirs_price, 2, '.', '') . " lv.";
- }else if ($team === 'Croatia' && $souvenirs_type === 'posters'){
- $souvenir_price = 4.95;
- $total_souvenirs_price = $souvenir_price * $souvenirs_count;
- echo "Pepi bought $souvenirs_count $souvenirs_type of $team for " . number_format($total_souvenirs_price, 2, '.', '') . " lv.";
- }else if ($team === 'Croatia' && $souvenirs_type === 'stickers'){
- $souvenir_price = 1.1;
- $total_souvenirs_price = $souvenir_price * $souvenirs_count;
- echo "Pepi bought $souvenirs_count $souvenirs_type of $team for " . number_format($total_souvenirs_price, 2, '.', '') . " lv.";
- }else if ($team === 'Denmark' && $souvenirs_type === 'flags'){
- $souvenir_price = 3.1;
- $total_souvenirs_price = $souvenir_price * $souvenirs_count;
- echo "Pepi bought $souvenirs_count $souvenirs_type of $team for " . number_format($total_souvenirs_price, 2, '.', '') . " lv.";
- }else if ($team === 'Denmark' && $souvenirs_type === 'caps'){
- $souvenir_price = 6.5;
- $total_souvenirs_price = $souvenir_price * $souvenirs_count;
- echo "Pepi bought $souvenirs_count $souvenirs_type of $team for " . number_format($total_souvenirs_price, 2, '.', '') . " lv.";
- }else if ($team === 'Denmark' && $souvenirs_type === 'posters'){
- $souvenir_price = 4.8;
- $total_souvenirs_price = $souvenir_price * $souvenirs_count;
- echo "Pepi bought $souvenirs_count $souvenirs_type of $team for " . number_format($total_souvenirs_price, 2, '.', '') . " lv.";
- }else if ($team === 'Denmark' && $souvenirs_type === 'stickers'){
- $souvenir_price = 0.9;
- $total_souvenirs_price = $souvenir_price * $souvenirs_count;
- echo "Pepi bought $souvenirs_count $souvenirs_type of $team for " . number_format($total_souvenirs_price, 2, '.', '') . " lv.";
- }else if ($team !== 'Argentina' && $team !== 'Brazil' && $team !== 'Croatia' && $team !== 'Denmark'){
- echo "Invalid country!";
- }else{ $souvenirs_type !== 'flags' && $souvenirs_type !== 'caps' && $souvenirs_type !== 'posters' && $souvenirs_type !== 'stickers';
- echo "Invalid stock!";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement