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.IO;
- namespace ConsoleApplication4
- {
- class Program
- {
- static void Main(string[] args)
- {
- string[] lines = File.ReadAllLines("LapTimes.txt");
- double currentLapStartTime = 0;
- double fastestLapTime = 0;
- foreach (string line in lines)
- {
- double lapEndTime = double.Parse(line);
- double lapTime = lapEndTime - currentLapStartTime;
- if (fastestLapTime == 0 || lapTime < fastestLapTime)
- {
- fastestLapTime = lapTime;
- }
- currentLapStartTime = lapEndTime;
- }
- Console.WriteLine("Czas najszybszego okrazenia: " + fastestLapTime);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement