grach

2016_18_Dec_Distance

Jul 20th, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.55 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 Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var startSpeed = int.Parse(Console.ReadLine());
  14.             var AccTime = int.Parse(Console.ReadLine());
  15.             var DownTime = int.Parse(Console.ReadLine());
  16.             var EndTime = int.Parse(Console.ReadLine());
  17.  
  18.             var Startlenght = (startSpeed*AccTime)       ;
  19.             var AccLenght = (startSpeed * 1.1 * DownTime) ;
  20.             var Time = ((startSpeed*1.1*0.95)*EndTime) ;
  21.  
  22.             var total = (Startlenght + AccLenght + DownTime)/60 ;
  23.  
  24.             Console.WriteLine("{0:f2}", total);          
  25.         }
  26.     }
  27. }
  28.  
  29. /*
  30. using System;
  31. using System.Collections.Generic;
  32. using System.Linq;
  33. using System.Text;
  34. using System.Threading.Tasks;
  35.  
  36. namespace Distance
  37. {
  38.     class Program
  39.     {
  40.         static void Main(string[] args)
  41.         {
  42.             int speed = int.Parse(Console.ReadLine());
  43.             var accTime = int.Parse(Console.ReadLine()) / 60.0;
  44.             var downTime = int.Parse(Console.ReadLine()) / 60.0;
  45.             var tmeEnd = int.Parse(Console.ReadLine()) / 60.0;
  46.  
  47.             var distance1 = (speed * accTime);
  48.             var distance2 = (speed * 1.1 * downTime);
  49.             var distance3 = (((speed * 1.1) * 0.95) * tmeEnd);
  50.  
  51.  
  52.             double result = (distance1 + distance2 + distance3);
  53.  
  54.             Console.WriteLine("{0:f}", result);
  55.         }
  56.     }
  57. }
  58. */
Advertisement
Add Comment
Please, Sign In to add comment