-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
33 lines (26 loc) · 933 Bytes
/
Program.cs
File metadata and controls
33 lines (26 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
// int CheckInputNumbers(int m){
// int result = 0;
// int number = 0;
// System.Console.WriteLine($"Введите {m} чисел");
// for (int i = 1; i <= m; i++){
// number = Convert.ToInt32(Console.ReadLine());
// if (number > 0){
// result++;
// }
// }
// return result;
// }
// System.Console.WriteLine($"Положительных чисел - {CheckInputNumbers(5)}");
int InputOdd(string message){
System.Console.Write($"{message} = ");
return Convert.ToInt32(Console.ReadLine());
}
string SearchPoint(int b1, int k1, int b2, int k2){
double x = Math.Round((Convert.ToDouble((b2-b1)) / (k1-k2)), 2);
double y = k1*x + b1;
string result = "(" + x + "; " + y + ")";
return result;
}
string result = SearchPoint(InputOdd("b1"), InputOdd("k1"),
InputOdd("b2"), InputOdd("k2"));
System.Console.WriteLine(result);