x
2
+
y
2
=
16
...
...
...
...
...
...
.
.
(
1
)
x + y = 4 (2)
rearrange (2) to y = 4 - x (could do x = 4 - y )
substitute y = 4 - x into (1)
hence:
x
2
+
(
4
−
x
)
2
=
16
⇒
x
2
+
16
−
8
x
+
x
2
=
16
and
2
x
2
−
8
x
+
16
−
16
=
0
⇒
2
x
2
−
8
x
=
0
factor and solve : 2x(x - 4 ) = 0
⇒
x
=
0
,
x
=
4
substitute these values into y = 4 - x , to find corresponding values of y.
x = 0 : y = 4 - 0 = 4 → (0 , 4)
x = 4 : y = 4 - 4 = 0 → (4 , 0 )
These are the points of intersection with the line x +y = 4 and the circle
x
2
+
y
2
=
16
Answer link
Объяснение:
#include<iostream>
using namespace std;
int main()
{
setlocale( LC_ALL, "Russian" );
float a,b,s;
int dp;
cout << "Привет! Я калькулятор!Какие действие вы будете выполнять:" << endl;
cout << "1. Сложение. " << endl;
cout << "2. Отнимание." << endl;
cout << "3. Умножение." << endl;
cout << "4. Деление." << endl;
cout << "Введите число для выбора действия" << endl;
cin >> dp;
switch(dp)
{
case 1:
cout << "Число a = " << endl;
cin >> a;
cout << "Число b = " << endl;
cin >> b;
s = a + b;
cout << "\n" << a << " * " << b << " = "<< s << endl;
break;
case 2:
cout << "Число a = " << endl;
cin >> a;
cout << "Число b = " << endl;
cin >> b;
s = a - b;
cout << "\n" << a << " * " << b << " = "<< s << endl;
break;
case 3:
cout << "Число a = " << endl;
cin >> a;
cout << "Число b = " << endl;
cin >> b;
s = a * b;
cout << "\n" << a << " * " << b << " = "<< s << endl;
break;
case 4:
cout << "Число a = " << endl;
cin >> a;
cout << "Число b = " << endl;
cin >> b;
s = a / b;
cout << "\n" << a << " / " << b << " = "<< s << endl;
break;
}
return 0;
}
1