Advertisement
Guest User

Untitled

a guest
Nov 20th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. using System;
  2. using System.Collections;
  3.  
  4. namespace ConsoleApp1
  5. {
  6. class Program
  7. {
  8. static void Main(string[] args)
  9. {
  10. bool b = false;
  11. int week = 0;
  12. int x = 0;
  13.  
  14. int[] setlista = new int[7] {5, 15, 20, 25, 30, 35, 40 };
  15. int[] lottolista = new int[7];
  16.  
  17. Random rnd = new Random();
  18. do
  19. {
  20. for (int i = 0; i <= 6; i++)
  21. {
  22. lottolista[i] = rnd.Next(1, 40);
  23. }
  24.  
  25.  
  26. for (int i = 0; i <= 6; i++)
  27. {
  28. if (lottolista[i] == setlista[i])
  29. {
  30. x++;
  31. if(x == 6)
  32. {
  33. b = true;
  34. for (int xs = 0; xs <= 6; xs++)
  35. {
  36. Console.Write(lottolista[xs] + ",");
  37. }
  38. }
  39. }
  40. else
  41. {
  42. x = 0;
  43. }
  44. }
  45.  
  46. week++;
  47. if (week < 52)
  48. {
  49. Console.WriteLine(week);
  50. }
  51. else
  52. {
  53. Console.WriteLine(week / 52);
  54. }
  55. } while (b == false);
  56. Console.WriteLine("Onnistu");
  57. Console.ReadLine();
  58. }
  59. }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement