Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace ConsoleApp1
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("Podaj rozmiar: ");
- string liczba = Console.ReadLine();
- int rozmiar = int.Parse(liczba);
- int[] a = new int[10];
- for(int i=0;i<rozmiar;i++)
- {
- Console.WriteLine("Podaj liczbe: ");
- string numer = Console.ReadLine();
- int parsednumer = int.Parse(liczba);
- a[i] = parsednumer;
- }
- int sum = 0;
- for (int i = 0; i < a.Length; i++)
- {
- sum += a[i];
- }
- Console.WriteLine(sum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement