Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections;
- namespace ConsoleApp1
- {
- class Program
- {
- static void Main(string[] args)
- {
- bool b = false;
- int week = 0;
- int x = 0;
- int[] setlista = new int[7] {5, 15, 20, 25, 30, 35, 40 };
- int[] lottolista = new int[7];
- Random rnd = new Random();
- do
- {
- for (int i = 0; i <= 6; i++)
- {
- lottolista[i] = rnd.Next(1, 40);
- }
- for (int i = 0; i <= 6; i++)
- {
- if (lottolista[i] == setlista[i])
- {
- x++;
- if(x == 6)
- {
- b = true;
- for (int xs = 0; xs <= 6; xs++)
- {
- Console.Write(lottolista[xs] + ",");
- }
- }
- }
- else
- {
- x = 0;
- }
- }
- week++;
- if (week < 52)
- {
- Console.WriteLine(week);
- }
- else
- {
- Console.WriteLine(week / 52);
- }
- } while (b == false);
- Console.WriteLine("Onnistu");
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement