Advertisement
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;
- using System.Threading.Tasks;
- namespace Matrix10
- {
- class Program
- {
- static void Main(string[] args)
- {
- int i, j;
- int[,] m = new int[7, 7];
- Random rnd = new Random();
- for (i = 0; i < 7; i++)
- {
- for (j = 0; j < 7; j++)
- m[i, j] = rnd.Next(1, 7); // 8-rol 7-re modositottam
- }
- for (i = 0; i < 7; i++)
- {
- for (j = 0; j < 7; j++)
- Console.Write(m[i, j] + "\t");
- Console.WriteLine();
- }
- Console.WriteLine();
- int[] histogram = new int[6];
- for (i = 0; i < 7; i++)
- for (j = 0; j < 7; j++)
- histogram[m[i, j] - 1]++;
- for (i = 0; i < 6; i++)
- Console.WriteLine("{0}: {1} db", i + 1, histogram[i]);
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement