Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 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. using System.Threading;
  7.  
  8. namespace pr2
  9. {
  10.  
  11. class Program
  12. {
  13. static void Main(string[] args)
  14. {
  15. thread2 = new Thread(Write);
  16. thread2.Start();
  17. do
  18. {
  19.  
  20. input = Convert.ToInt32(Console.ReadLine());
  21. if (input == 0)
  22. {
  23. thread2.Abort();
  24. }
  25.  
  26.  
  27. } while (input != 0);
  28. }
  29. private static void Write(object obj)
  30. {
  31. do
  32. {
  33. Console.WriteLine("Nr citit anterior este: {0}", input);
  34. Thread.Sleep(1000);
  35.  
  36. } while (input!=null) ;
  37.  
  38.  
  39. }
  40.  
  41. public static Thread thread2 { get; set; }
  42.  
  43. static int input { get; set; }
  44.  
  45. }
  46.  
  47.  
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement