Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _2017_07_May_Toy_Shop
- {
- class Program
- {
- static void Main(string[] args)
- {
- var Travel = double.Parse(Console.ReadLine());
- var Puzzles = double.Parse(Console.ReadLine());
- var speakDoll = double.Parse(Console.ReadLine());
- var teddyBear = double.Parse(Console.ReadLine());
- var minion = double.Parse(Console.ReadLine());
- var trucks = double.Parse(Console.ReadLine());
- var toys = Puzzles + speakDoll + teddyBear + minion + trucks;
- var puzzlePrice = 2.60;
- var spekDollPri = 3.00;
- var teddyBeaPri = 4.10;
- var minionPrice = 8.20;
- var trucksPrice = 2.00;
- var totalPrice = puzzlePrice*Puzzles + spekDollPri*speakDoll + teddyBeaPri*teddyBear + minionPrice*minion+trucksPrice*trucks;
- if (toys>=50)
- {
- totalPrice -= totalPrice * 0.25;
- }
- totalPrice -= totalPrice * 0.1;
- if (totalPrice >= Travel)
- {
- Console.WriteLine($"Yes! { (totalPrice - Travel):f2} lv left.");
- }
- else
- {
- Console.WriteLine($"Not enough money! {Math.Abs(Travel-totalPrice):f2} lv needed.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment