Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MyClass {
- static void Main() {
- int[] array = InitArray();
- PrintArray(array);
- }
- public void PrintArray(int[] array) {
- for (int i = 0; i < array.length; i++) {
- Console.Write(array[i].toString());
- }
- }
- public int[] InitArray() {
- Console.Write("Размер:");
- int size = ReadIntLine();
- int[] array = new int[size];
- Console.Write("Элементы: ");
- for (int i = 0; i < array.length; i++) {
- array[i] = ReadIntLine();
- }
- return array;
- }
- public int ReadIntLine() {
- return Convert.ToInt32(Console.ReadLine());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement