-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTask21
More file actions
18 lines (15 loc) · 819 Bytes
/
Task21
File metadata and controls
18 lines (15 loc) · 819 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Расстояние между двумя точками по их координатам в 3D
Console.Write("Введите x1 для точки А: ");
int x1 = int.Parse(Console.ReadLine());
Console.Write("Введите y1 для точки А: ");
int y1 = int.Parse(Console.ReadLine());
Console.Write("Введите z1 для точки А: ");
int z1 = int.Parse(Console.ReadLine());
Console.Write("Введите x2 для точки В: ");
int x2 = int.Parse(Console.ReadLine());
Console.Write("Введите y2 для точки В: ");
int y2 = int.Parse(Console.ReadLine());
Console.Write("Введите z2 для точки В: ");
int z2 = int.Parse(Console.ReadLine());
double s = Math.Sqrt(Math.Pow(x1 - x2, 2) + Math.Pow(y1 - y2, 2) + Math.Pow(z1 - z2, 2));
Console.WriteLine($"s={s:f3}");