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;
- namespace gyaksergy
- {*/
- class Program
- {
- static void Tombkiiras(int[] a)
- {
- Random r = new Random();
- for (int i = 0; i < a.Length - 1; i++)
- {
- //héfő
- if (i == 0 || i == 7 || i == 14 || i == 21 || i == 28 || i == 35)
- {
- a[i] = r.Next(5, 16);
- }
- //kedd
- if (i == 1 || i == 8 || i == 15 || i == 22 || i == 29 || i == 36)
- {
- a[i] = r.Next(8, 19);
- }
- //szerda
- if (i == 2 || i == 9 || i == 16 || i == 23 || i == 30 || i == 37)
- {
- a[i] = r.Next(10, 21);
- }
- //csütörtök
- if (i == 3 || i == 10 || i == 17 || i == 24 || i == 31 || i == 38)
- {
- a[i] = r.Next(8, 19);
- }
- //péntek
- if (i == 4 || i == 11 || i == 18 || i == 25 || i == 32 || i == 39)
- {
- a[i] = r.Next(10, 21);
- }
- //szombat
- if (i == 5 || i == 12 || i == 19 || i == 26 || i == 33 || i == 40)
- {
- a[i] = r.Next(5, 16);
- }
- //vasárnap
- if (i == 6 || i == 13 || i == 20 || i == 27 || i == 34 || i == 41)
- {
- a[i] = r.Next(30, 41);
- }
- a[41] = 42;
- }
- for (int i = 0; i < a.Length; i++)
- {
- Console.Write(a[i]+ " ");
- }
- }
- static void OsszHet(int[] b)
- {
- int[] het = new int[6];
- for (int i = 0; i < het.Length; i++)
- {
- for (int j = 0; j < b.Length; j++)
- {
- do
- {
- het[i] += b[j];
- }
- while (j < 7);
- Console.WriteLine(het[i]);
- }
- }
- }
- static void Main(string[] args)
- {
- int[] edz = new int[42];
- int[] ossz = new int[6];
- Tombkiiras(edz);
- OsszHet(ossz);
- Console.ReadLine();
- }
- }
Add Comment
Please, Sign In to add comment