-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
42 lines (32 loc) · 863 Bytes
/
Copy pathProgram.cs
File metadata and controls
42 lines (32 loc) · 863 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
40
41
42
// See https://aka.ms/new-console-template for more information
Console.WriteLine("Введите трехзначное число");
int number1 = Convert.ToInt32(Console.ReadLine());
while (number1 < 100)
{
Console.WriteLine("Введите трехзначное число");
number1 = Convert.ToInt32(Console.ReadLine());
}
int otvet1 = (number1 % 100) / 10;
Console.WriteLine(otvet1);
Console.WriteLine("Введите число");
int number2 = Convert.ToInt32(Console.ReadLine());
string num = number2.ToString();
if (num[2] > 0)
{
Console.WriteLine (num[2]);
}
else
{
Console.WriteLine("Третьей цифры нет");
}
int sum = Convert.ToInt32(Console.ReadLine());
int (a) = 1;
if (sum>99)
{
a = (sum % 100) % 10;
Console.WriteLine (a);
}
else
{
Console.WriteLine("Третьей цифры нет");
}