Last active
September 29, 2016 11:37
-
-
Save dz0/3120cf2307cdde375b508a6090469c76 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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