Advertisement
Guest User

Untitled

a guest
Dec 14th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.98 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.  
  7. namespace ConsoleApp13
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var rand = new Random();
  14.             int[,] tab = new int[10, 10];
  15.             int count = 0;
  16.             string losowania = "";
  17.            
  18.             for (int i = 0; i < 10; i++)
  19.             {
  20.                 for (int j = 0; j < 10; j++)
  21.                 {
  22.                     tab[i, j] = rand.Next(1, 7);
  23.                     Console.Write(tab[i, j] + " ");
  24.                     count++;
  25.                     if (tab[i, j] == 6)
  26.                     {
  27.                         losowania += count + " ";
  28.                     }
  29.                 }
  30.                
  31.    
  32.                 Console.WriteLine("\n");
  33.             }
  34.             Console.WriteLine("|6 wypadła w losowaniach: " + losowania);
  35.             Console.ReadKey();
  36.         }
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement