Advertisement
spasnikolov131

Untitled

May 12th, 2021
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Fuel_Tank
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. string fuel = Console.ReadLine().ToLower();
  10. int liters = int.Parse(Console.ReadLine());
  11.  
  12. if (fuel == "diesel" || fuel == "gasoline" || fuel == "gas")
  13. {
  14. if (liters >= 25)
  15. {
  16.  
  17. Console.WriteLine($"You have enough {fuel}.");
  18.  
  19. }
  20. else
  21. {
  22. Console.WriteLine($"Fill your tank with {fuel}!");
  23. }
  24. }
  25. else
  26. {
  27. Console.WriteLine("Invalid fuel!");
  28. }
  29. }
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement