Advertisement
Guest User

Untitled

a guest
Nov 24th, 2014
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApplication23
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. Console.WriteLine("TABLICA 1-WYMIAROWA");
  14. int[] tab = new int[10];
  15. Random r = new Random();
  16. for (int i = 0; i < tab.Length; i++)
  17. {
  18. tab[i] = r.Next(21);
  19.  
  20. }
  21. WypiszTab(tab, "Elementy tablicy:");
  22.  
  23.  
  24.  
  25. Console.ReadKey();
  26. }
  27. static void WypiszTab(int[] tab , string opis)
  28. {
  29. Console.WriteLine();
  30. Console.WriteLine(opis);
  31. foreach(int elem in tab)
  32. {
  33. Console.Write(elem + "\t");
  34. }
  35.  
  36. }
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement