Advertisement
Guest User

Untitled

a guest
Jul 25th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.45 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.IO;
  7.  
  8. namespace ConsoleApp1
  9. {
  10.     class Program
  11.     {
  12.         static void Main(string[] args)
  13.         {
  14.             int nrO = 0, nr1 = 0, nr2 = 0;
  15.             List<int> nrObrazu = new List<int>();
  16.             List<int> nrBox = new List<int>();
  17.             for (int j = 0; j < 64; j++)
  18.                 nrObrazu.Add(j + 1);
  19.             for (int j = 0; j < 16; j++)
  20.                 nrBox.Add(j + 1);
  21.  
  22.             for (int i = 0; i < 16/2; i++)
  23.             {
  24.                 var Obrazy = nrObrazu.OrderBy(a => Guid.NewGuid());
  25.                 nrO = Obrazy.First();
  26.                 nrObrazu.Remove(nrO);
  27.  
  28.                 var Boxy = nrBox.OrderBy(a => Guid.NewGuid());
  29.                 nr1 = Boxy.First();
  30.                 nrBox.Remove(nr1);
  31.                 nr2 = Boxy.First();
  32.                 nrBox.Remove(nr2);
  33.                 Console.Write(nrO + " " + "numery obrazow: ");
  34.                 for(int j=0;j<nrObrazu.Count();j++)
  35.                     Console.Write(nrObrazu[j] + " ");
  36.                 Console.WriteLine();
  37.                 Console.Write(nr1 + " " + nr2 + " " + "numery obrazow: ");
  38.                 for (int j = 0; j < nrBox.Count(); j++)
  39.                     Console.Write(nrBox[j] + " ");
  40.                 Console.WriteLine();
  41.             }
  42.            
  43.             Console.ReadKey();
  44.         }
  45.     }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement