22 lines
547 B
C#
22 lines
547 B
C#
using System;
|
|
|
|
public class Program
|
|
{
|
|
public static void Main(string[] args)
|
|
{
|
|
int[] myArray;
|
|
Console.WriteLine("input an amount of elements: ");
|
|
int n = int.Parse(Console.ReadLine());
|
|
Console.WriteLine("input elements one by one: ");
|
|
myArray = new int[n];
|
|
|
|
for (int i = 0; i < myArray.Length; ++i)
|
|
{
|
|
Console.Write("a[{0}] = ", i);
|
|
myArray[i] = int.Parse(Console.ReadLine());
|
|
}
|
|
|
|
foreach (int x in myArray) Console.Write("{0} ", x);
|
|
}
|
|
}
|