Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _01.Sandbox
- {
- class Program
- {
- static void Main(string[] args)
- {
- var distance = double.Parse(Console.ReadLine());
- var razhod = double.Parse(Console.ReadLine());
- var benzin = double.Parse(Console.ReadLine());
- var budget = double.Parse(Console.ReadLine());
- var smetka = budget - ((distance * (razhod / 100)) * benzin);
- if (smetka >= 0)
- {
- Console.Write("You can take a trip. ");
- Console.Write("{0:f2}", smetka);
- Console.Write(" money left.");
- }
- else
- {
- Console.Write("Sorry, you cannot take a trip. Each will receive ");
- Console.Write("{0:f2}", budget/5);
- Console.Write(" money.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement