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 ConsoleApp18
- {
- class Zadanie2
- {
- public static void Main()
- {
- /* 2 */
- int[] gg = new int[20];
- Random random = new Random();
- for (int i=0; i<20; i++)
- {
- var arr = Enumerable.Range(5, 30).Select(n => random.Next(5, 30)).ToArray();
- Console.WriteLine(String.Join(" ", gg));
- Console.ReadKey();
- }
- }
- }
- class Program
- {
- static void Main(string[] args)
- { /* 1 */
- Random rnd = new Random();
- int[] arr = new int[6];
- for(int i=0; i<6; i++)
- {
- arr[i] = rnd.Next(1, 49);
- Console.WriteLine(String.Join(" ", arr));
- var val = arr.GroupBy(x => x).OrderByDescending(x => x.Count()).First().Key;
- Console.ReadKey();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement