using System;
namespace trip
{
class Program
{
private static Random rnd = new Random();
static void Main(string[] args)
{
var storage = new int[10];
var numberOfSurfers = int.Parse(Console.ReadLine());
if (numberOfSurfers > 10)
{
Console.WriteLine("Number of surfers: 1-10");
return;
}
for (var i = 0; i < numberOfSurfers; i++)
{
storage[i] = getPoints();
}
var storageCopy = makeCopy(storage);
var highestScore = getHighest(storageCopy);
Console.WriteLine("=====Highest Score=====");
Console.WriteLine(highestScore);
}
static int getHighest(int[] arr)
{
Array.Sort(arr);
Array.Reverse(arr);
return arr[0]; ;
}
static int[] makeCopy(int[] arr)
{
int[] newArr = new int[arr.Length];
arr.CopyTo(newArr, 0);
return newArr;
}
static int getPoints()
{
var points = rnd.Next(1, 10);
return points;
}
}
}
Comments
Leave a comment