Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program
- {
- static void Main()
- {
- string product = Console.ReadLine().ToLower(), town = Console.ReadLine().ToLower();
- float quantity = float.Parse(Console.ReadLine());
- /*град / продукт coffee water beer sweets peanuts
- Sofia 0.50 0.80 1.20 1.45 1.60
- Plovdiv 0.40 0.70 1.15 1.30 1.50
- Varna 0.45 0.70 1.10 1.35 1.55*/
- if (town == "sofia")
- {
- if (product == "coffee")
- {
- Console.WriteLine(0.50 * quantity);
- }
- else if (product == "water")
- {
- Console.WriteLine(0.80 * quantity);
- }
- else if (product == "beer")
- {
- Console.WriteLine(1.20 * quantity);
- }
- else if (product == "sweets")
- {
- Console.WriteLine(1.45 * quantity);
- }
- else if (product == "peanuts")
- {
- Console.WriteLine(1.60 * quantity);
- }
- }
- if (town == "plovdiv")
- {
- if (product == "coffee")
- {
- Console.WriteLine(0.40 * quantity);
- }
- else if (product == "water")
- {
- Console.WriteLine(0.70 * quantity);
- }
- else if (product == "beer")
- {
- Console.WriteLine(1.15 * quantity);
- }
- else if (product == "sweets")
- {
- Console.WriteLine(1.30 * quantity);
- }
- else if (product == "peanuts")
- {
- Console.WriteLine(1.50 * quantity);
- }
- }
- if (town == "varna")
- {
- if (product == "coffee")
- {
- Console.WriteLine(0.45 * quantity);
- }
- else if (product == "water")
- {
- Console.WriteLine(0.70 * quantity);
- }
- else if (product == "beer")
- {
- Console.WriteLine(1.10 * quantity);
- }
- else if (product == "sweets")
- {
- Console.WriteLine(1.35 * quantity);
- }
- else if (product == "peanuts")
- {
- Console.WriteLine(1.55 * quantity);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement