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.Threading.Tasks;
- using System.Threading;
- namespace pr2
- {
- class Program
- {
- static void Main(string[] args)
- {
- thread2 = new Thread(Write);
- thread2.Start();
- do
- {
- input = Convert.ToInt32(Console.ReadLine());
- if (input == 0)
- {
- thread2.Abort();
- }
- } while (input != 0);
- }
- private static void Write(object obj)
- {
- do
- {
- Console.WriteLine("Nr citit anterior este: {0}", input);
- Thread.Sleep(1000);
- } while (input!=null) ;
- }
- public static Thread thread2 { get; set; }
- static int input { get; set; }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement