-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
39 lines (33 loc) · 933 Bytes
/
Program.cs
File metadata and controls
39 lines (33 loc) · 933 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// See https://aka.ms/new-console-template for more information
Console.WriteLine ("Введите количество элементов массива: ");
int size = Convert.ToInt32(Console.ReadLine());
string[] arrString = new string[size];
for(int count = 0; count < size; count++)
{
Console.WriteLine ();
Console.WriteLine ("Введите элемент массива: ");
arrString[count] = Console.ReadLine();
}
void ShowArray(string [] array)
{
for (int i = 0; i < array.Length; i++)
{
Console.Write(array[i] + "; ");
}
Console.WriteLine();
}
Console.WriteLine();
ShowArray(arrString);
void CountElementsSize(string [] array)
{
for (int i = 0; i < array.Length; i++)
{
int length = array[i].Length;
if (length <= 3)
{
Console.Write($"{array[i]}; ");
}
}
}
Console.WriteLine();
CountElementsSize(arrString);