Advertisement
Cassimus

tablice

Apr 26th, 2025
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.14 KB | None | 0 0
  1. // string[] uczestnicy = new string[4];
  2. // uczestnicy[0] = "Szymon";
  3. // uczestnicy[1] = "Artur";
  4. // uczestnicy[2] = "Szymon";
  5. // uczestnicy[3] = "Grzesiek";
  6.  
  7. //string[] uczestnicy = new string[6]{"Szymon","Artur", "szymon", "Grzesiek"};
  8.  
  9. // string[] uczestnicy = ["Szymon", "Artur", "Szymon", "Grzesiek", "Jola", "Mariola"];
  10.  
  11. // for (int i = 0; i < uczestnicy.Length; i++)
  12. // {
  13. //     System.Console.WriteLine(uczestnicy[i]);
  14. // }
  15.  
  16. // string[] bibliotekaGier = { "Baldurs Gate3", "Guild Wars2", "Assasins Creed: Valhala", "Settlers 2" };
  17.  
  18. // for (int i = 0; i < bibliotekaGier.Length; i++)
  19. // {
  20. //     System.Console.WriteLine(bibliotekaGier[i]);
  21. // }
  22.  
  23. // Random maszynaLosujaca = new Random();
  24. // int wylosowanyIndex = maszynaLosujaca.Next(0, bibliotekaGier.Length);
  25.  
  26. // System.Console.WriteLine($"Proponuję zagrać wieczorem w {bibliotekaGier[wylosowanyIndex]}");
  27.  
  28. int[] liczby = new int[5];
  29.  
  30. int counter=0;
  31.  
  32. while (counter < liczby.Length)
  33. {
  34.     System.Console.WriteLine("Podaj liczbę i naciśnij ENTER");
  35.     liczby[i] = int.Parse(Console.ReadLine());
  36. }
  37.  
  38. foreach(int element in liczby)
  39. {
  40.     Console.WriteLine(element);2
  41. }
  42.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement