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 ConsoleApplication2
- {
- class Program
- {
- static void Main(string[] args)
- {
- int[] tomb = new int[10];
- Random r = new Random();
- for (int i = 0; i < 10; i++)
- {
- tomb[i] = r.Next(0, 100);
- Console.WriteLine(tomb[i]);
- }
- int max = tomb[0];
- int min = tomb[0];
- for (int i = 0; i < 10; i++)
- {
- if (tomb[i]>max)
- {
- max = tomb[i];
- }
- if (tomb[i] < min)
- {
- min = tomb[i];
- }
- }
- Console.WriteLine($"Max:{max}");
- Console.WriteLine($"Min:{min}");
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement