Skip to content

Instantly share code, notes, and snippets.

@dz0
Last active September 29, 2016 11:37
Show Gist options
  • Select an option

  • Save dz0/3120cf2307cdde375b508a6090469c76 to your computer and use it in GitHub Desktop.

Select an option

Save dz0/3120cf2307cdde375b508a6090469c76 to your computer and use it in GitHub Desktop.
using System;
class MainClass {
public static void Main (string[] args) {
int[] spejimai = new int[5]; // aprašome masyvą, kuriame galėsim saugoti 5 sveikus skaičius.
Random rnd = new Random(); // atsitiktinių sk. generatorius
for(int i=0; i<5; i++) // pagal eilės numerį: 0 1 2 3 4
{
spejimai[i] = rnd.Next(1, 10); // priskiriam masyvo elementams atsitiktines reikšmes
}
for(int i=0; i<5; i++) // pagal eilės numerį
{
Console.WriteLine (spejimai[i]); // atspausdinam masyvo elementus
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment