Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp10
- {
- internal class Program
- {
- private static void Main(string[] args)
- {
- #region TabliceJednoWymiarowe
- int[] burok;
- double[] ogórek = { 1, 2, 4, 5, 6, 7, 8, 9, 0, 4 };
- int[] krowa = new int[] { 1, 2, 3, 4, 6 };
- double[] ziemniak = new double[10];
- ziemniak[0] = 12;
- double[] batat = new double[4] { 34, 423, 234, 22 };
- double[] batat_kopia = batat;
- batat = new double[3];
- if (batat_kopia.Length > batat.Length)
- {
- batat = new double[batat_kopia.Length];
- }
- for (int i = 0; i < batat_kopia.Length; i++)
- {
- batat[i] = batat_kopia[i];
- }
- batat_kopia = null;
- #endregion
- #region TabliceWieloWymiarowe
- string[,] NazwiskoImie = new string[2, 2] { { "", "" }, { "Nowak", "Henryk" } };
- NazwiskoImie[0, 0] = "Kowalski";
- NazwiskoImie[0, 1] = "Jan";
- var a = NazwiskoImie[1, 1] + "" + NazwiskoImie[1, 0];
- #endregion
- #region TabliceParametryczne
- TablicaParametryczna tp = new TablicaParametryczna();
- int wartośćSumy = tp.DodajElementy(4, 233, 23, 1, 2, 3);
- #endregion
- Console.ReadKey();
- }
- }
- #region TworzenieTablicyParametrycznej
- class TablicaParametryczna
- {
- public int DodajElementy(params int[] tablica)
- {
- int suma = 0;
- foreach (var item in tablica)
- {
- suma += item;
- }
- return suma;
- }
- }
- #endregion
- }
Add Comment
Please, Sign In to add comment