The task of the area of a right triangle. Set the legs. How much will the area of a right-angled triangle increase if one of the legs is doubled and the second one is increased 3 times? It is necessary to solve this problem in C ++. The formula of a right triangle is 1/2ab ( 1/2 is a fraction). Help, please solve!
Closed due to the fact that off-topic participants default locale , Harry , Fat-Zer , 0xdb , Vadizar Apr 12 '18 at 5:25 .
It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:
- " Learning tasks are allowed as questions only on the condition that you tried to solve them yourself before asking a question . Please edit the question and indicate what caused you difficulties in solving the problem. For example, give the code you wrote, trying to solve the problem "- default locale, Harry, Fat-Zer, 0xdb, Vadizar
- 3And where does C ++ come from? An elementary problem, not even in geometry, but pure arithmetic. - VladD
- oneWhat exactly is incomprehensible to you? - Harry
- oneWhat is the problem? - ishidex2
|
1 answer
#include <iostream> #include <conio.h> using namespace std; int main() { cout << "Cathetus a = "; double a = 0; cin >> a; cout << "Cathetus b = "; double b = 0; cin >> b; double S1 = a * b / 2.0; cout << "Area S1 = " << S1 << endl; double S2 = (a * 2) * (b * 3) / 2.0; cout << "If a2 = 2 * a and b2 = b * 3 then S2 = " << S2 << endl; cout << "Difference is S2 - S1 = " << S2 - S1 << endl; _getch(); return 0; } - Please try to leave a little more detailed answers. You can add an answer by clicking edit - aleksandr barakin
- You need to compare the expression x * 2 * 3 with the expression x. It only remains to answer: "six times ..." - AR Hovsepyan
- @ARHovsepyan, the question is “how much”, not “how much”, so this is probably the difference between them S2-S1. Added this code. - Olga Semenkina
|