using System using System Collections Generic using System Linq using

 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace first_and_ninth
{
class Program
{
static void Main(string[] args)
{
//Task 1
Console.WriteLine("Enter ONE letter:");
string c = Console.ReadLine();
c = c.ToLower();
int [] nums = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
for (int i = 0; i<nums.Length; i++)
{
if (c == Convert.ToString(nums[i]))
{
Console.WriteLine("Digit");
}
}
int engCount = 0;
int rusCount = 0;
foreach (char lett in c)
{
if ((lett > 'а' && lett < 'я') || (lett > 'А' && lett < 'Я'))
rusCount++;
if ((lett > 'a' && lett < 'z') || (lett > 'A' && lett < 'Z'))
engCount++;
}
if (rusCount > 0)
Console.WriteLine("Rus");
else if (engCount > 0)
Console.WriteLine("Lat");
//Task 2
string s1 = Console.ReadLine();
string[] s2 = s1.Split(' ');
string[] s3 = s2.Where(n => !string.IsNullOrEmpty(n)).ToArray();
for (int i = 0; i<s3.Length;i++)
{
Console.WriteLine(s3[i]);
}
Console.ReadLine();
}
}
}