Advertisement
Guest User

4.3

a guest
Sep 29th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.51 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Application
  4. {
  5.     class MainClass
  6.     {
  7.         public static void Main (string[] args)
  8.         {
  9.             Random rand = new Random ();
  10.             int n = rand.Next (15);
  11.             int[] array = new int[n];
  12.             int min = 0;
  13.  
  14.             for (int i = 0; i < n; i++) {
  15.                 array [i] = rand.Next (100) - 50;
  16.                 if (array [i] >= 0 && min < array [i])
  17.                     min = array [i];
  18.             }
  19.             foreach (int x in array)
  20.                 Console.Write (x + " ");
  21.  
  22.             Console.WriteLine ();
  23.             Console.WriteLine (min);
  24.  
  25.  
  26.             Console.Read ();
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement