Guest User

Untitled

a guest
Jan 19th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.59 KB | None | 0 0
  1. using System;
  2. /*using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace gyaksergy
  7. {*/
  8.     class Program
  9.     {
  10.         static void Tombkiiras(int[] a)
  11.         {
  12.             Random r = new Random();
  13.             for (int i = 0; i < a.Length - 1; i++)
  14.             {
  15.  
  16.                 //héfő
  17.                 if (i == 0 || i == 7 || i == 14 || i == 21 || i == 28 || i == 35)
  18.                 {
  19.                     a[i] = r.Next(5, 16);
  20.  
  21.                 }
  22.                 //kedd
  23.                 if (i == 1 || i == 8 || i == 15 || i == 22 || i == 29 || i == 36)
  24.                 {
  25.                     a[i] = r.Next(8, 19);
  26.  
  27.                 }
  28.                 //szerda
  29.                 if (i == 2 || i == 9 || i == 16 || i == 23 || i == 30 || i == 37)
  30.                 {
  31.                     a[i] = r.Next(10, 21);
  32.  
  33.                 }
  34.                 //csütörtök
  35.                 if (i == 3 || i == 10 || i == 17 || i == 24 || i == 31 || i == 38)
  36.                 {
  37.                     a[i] = r.Next(8, 19);
  38.  
  39.                 }
  40.                 //péntek
  41.                 if (i == 4 || i == 11 || i == 18 || i == 25 || i == 32 || i == 39)
  42.                 {
  43.                     a[i] = r.Next(10, 21);
  44.  
  45.                 }
  46.                 //szombat
  47.                 if (i == 5 || i == 12 || i == 19 || i == 26 || i == 33 || i == 40)
  48.                 {
  49.                     a[i] = r.Next(5, 16);
  50.  
  51.                 }
  52.                 //vasárnap
  53.                 if (i == 6 || i == 13 || i == 20 || i == 27 || i == 34 || i == 41)
  54.                 {
  55.                     a[i] = r.Next(30, 41);
  56.  
  57.                 }
  58.  
  59.  
  60.                 a[41] = 42;
  61.  
  62.             }
  63.            
  64.             for (int i = 0; i < a.Length; i++)
  65.             {
  66.                
  67.                 Console.Write(a[i]+ " ");
  68.             }
  69.            
  70.         }
  71.  
  72.        static void OsszHet(int[] b)
  73.         {
  74.             int[] het = new int[6];
  75.             for (int i = 0; i < het.Length; i++)
  76.             {
  77.                 for (int j = 0; j < b.Length; j++)
  78.                 {
  79.                     do
  80.                     {
  81.                         het[i] += b[j];
  82.                     }
  83.                     while (j < 7);
  84.                     Console.WriteLine(het[i]);
  85.                 }
  86.                
  87.             }                    
  88.         }        
  89.        
  90.  
  91.  
  92.         static void Main(string[] args)
  93.         {
  94.             int[] edz = new int[42];
  95.             int[] ossz = new int[6];
  96.             Tombkiiras(edz);
  97.            OsszHet(ossz);
  98.             Console.ReadLine();
  99.         }
  100.     }
Add Comment
Please, Sign In to add comment