Advertisement
Guest User

Untitled

a guest
Feb 27th, 2017
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Distance
  8. {
  9. class Distance
  10. {
  11. static void Main(string[] args)
  12. {
  13. double a = double.Parse(Console.ReadLine());
  14. double b = double.Parse(Console.ReadLine());
  15. double c = double.Parse(Console.ReadLine());
  16. double d = double.Parse(Console.ReadLine());
  17.  
  18.  
  19. double aKm = a *(b / 60); // purvo
  20.  
  21. double aAfter = a + (10 * a / 100);
  22. double bKm = aAfter * (c / 60); // vtoro
  23.  
  24. double cPercent = aAfter - (5 * aAfter / 100);
  25. double cKm = cPercent * (d / 60); // treto
  26.  
  27. double total = aKm + bKm + cKm;
  28. Console.WriteLine("{0:f2}",total);
  29.  
  30.  
  31.  
  32.  
  33. //var pyrvo = a * (b / 60);
  34. //var vtoro = (a + (a * 0.1)) * (c / 60);
  35. //var treto = ((a + (a * 0.1)) -( a * 0.05)) * (d / 60);
  36. //var l = pyrvo + vtoro + treto;
  37. //Console.WriteLine("{0:f2}", l);
  38.  
  39.  
  40. }
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement