Untitled

mail@pastecode.io avatar
unknown
csharp
a year ago
384 B
2
Indexable
Never
Console.Write("Podaj wielkosc tablicy do utworzenia: ");
int wielkosc = Convert.ToInt32(Console.ReadLine());
int[] tablica = new int[wielkosc];
int suma = 0;
for(int i = 0; i < tablica.Count(); i++)
{
    Console.Write($"Podaj element {i} -- ");
    tablica[i] = Convert.ToInt32(Console.ReadLine());
    suma += tablica[i];
}
Console.WriteLine($"Suma elementow w tablicy to: {suma}");