Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Threading;
- namespace Loops
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.Write("Time for RED signal [sec]: ");
- int redTime = int.Parse(Console.ReadLine());
- Console.Write("Time for GREEN signal [sec]: ");
- int greenTime = int.Parse(Console.ReadLine());
- while (true)
- {
- Console.Clear();
- Console.WriteLine("RED");
- Thread.Sleep(redTime * 1000);
- Console.Clear();
- Console.WriteLine("RED, YELLOW");
- Thread.Sleep(1000);
- Console.Clear();
- Console.WriteLine("GREEN");
- Thread.Sleep(greenTime * 1000);
- Console.Clear();
- Console.WriteLine("YELLOW");
- Thread.Sleep(1000);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement