Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Добра практика:
- using System;
- namespace FoodDelivery
- {
- class Program
- {
- static void Main()
- {
- double chickenMenuPrice = 10.35;
- double fishMenuPrice = 12.40;
- double vegeterianMenuPrice = 8.15;
- double delivery = 2.50;
- int chickenMenuCount = int.Parse(Console.ReadLine());
- int fishMenuCount = int.Parse(Console.ReadLine());
- int vegetarianMenuCount = int.Parse(Console.ReadLine());
- double menuPrice = chickenMenuCount * chickenMenuPrice + fishMenuCount * fishMenuPrice + vegetarianMenuCount * vegeterianMenuPrice;
- double dessertPrice = menuPrice / 5;
- double totalPrice = menuPrice + dessertPrice + delivery;
- Console.WriteLine(totalPrice);
- }
- }
- }
- Или леко тарикатската:
- using System;
- namespace FoodDelivery
- {
- class Program
- {
- static void Main()
- {
- double chickenMenuPrice = int.Parse(Console.ReadLine()) * 10.35;
- double fishMenuPrice = int.Parse(Console.ReadLine()) * 12.40;
- double vegetarianMenuPrice = int.Parse(Console.ReadLine()) * 8.15;
- double delivery = 2.50;
- double menuPrice = chickenMenuPrice + fishMenuPrice + vegetarianMenuPrice;
- double totalPrice = menuPrice * 1.2 + delivery;
- Console.WriteLine(totalPrice);
- }
- }
- }
- Лоша практика:
- using System;
- namespace FoodDelivery
- {
- class Program
- {
- static void Main()
- {
- Console.WriteLine((int.Parse(Console.ReadLine()) * 10.35 + int.Parse(Console.ReadLine()) * 12.40 + int.Parse(Console.ReadLine()) * 8.15) * 1.2 + 2.5);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement