Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Distance
- {
- class Distance
- {
- static void Main(string[] args)
- {
- double a = double.Parse(Console.ReadLine());
- double b = double.Parse(Console.ReadLine());
- double c = double.Parse(Console.ReadLine());
- double d = double.Parse(Console.ReadLine());
- double aKm = a *(b / 60); // purvo
- double aAfter = a + (10 * a / 100);
- double bKm = aAfter * (c / 60); // vtoro
- double cPercent = aAfter - (5 * aAfter / 100);
- double cKm = cPercent * (d / 60); // treto
- double total = aKm + bKm + cKm;
- Console.WriteLine("{0:f2}",total);
- //var pyrvo = a * (b / 60);
- //var vtoro = (a + (a * 0.1)) * (c / 60);
- //var treto = ((a + (a * 0.1)) -( a * 0.05)) * (d / 60);
- //var l = pyrvo + vtoro + treto;
- //Console.WriteLine("{0:f2}", l);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement