Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace FuelTank2
- {
- class Program
- {
- static void Main(string[] args)
- {
- string fuel = Console.ReadLine();
- double liter = double.Parse(Console.ReadLine());
- string cart = Console.ReadLine();
- double sum = 0;
- if (fuel == "Gas")
- {
- sum = cart == "No" ? 0.93 : 0.85;
- }
- else if (fuel == "Gasoline")
- {
- sum = cart == "No" ? 2.22 : 2.04;
- }
- else if (fuel == "Diesel")
- {
- sum = cart == "No" ? 2.33 : 2.21;
- }
- sum = liter > 25 ? sum *= 0.9 : liter >= 20 ? sum *= 0.92 : sum;
- Console.WriteLine($"{sum * liter:F2} lv.");
- }
- }
- }
Add Comment
Please, Sign In to add comment