FaresX

Untitled

Dec 22nd, 2016
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.71 KB | None | 0 0
  1. using System;
  2.  
  3.  
  4. class Program
  5. {
  6.     static void Main(string[] args)
  7.     {
  8.         int initSpeed = int.Parse(Console.ReadLine());
  9.         int firstPeriod = int.Parse(Console.ReadLine());
  10.         int secondPeriod = int.Parse(Console.ReadLine());
  11.         int thirdPeriod = int.Parse(Console.ReadLine());
  12.         double initDistance = initSpeed * (firstPeriod / 60.0);
  13.         double startSpeed = (initSpeed + initSpeed * 0.1);
  14.         double incrDistance = startSpeed * (secondPeriod / 60.0);
  15.         double endSpeed = startSpeed - startSpeed * 0.05;
  16.         double decrDistance = endSpeed * (thirdPeriod / 60.0);
  17.         Console.WriteLine((initDistance + incrDistance + decrDistance).ToString("F"));
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment