-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pract 01 | Yordanka Ilieva #16
base: main
Are you sure you want to change the base?
Conversation
//cout << "Perimeter: " << P << '\n' << "Area: " << S; | ||
|
||
//Задача 3. | ||
//double a; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Променливата е по-добре да се казва lev
//double Discriminant = b * b - 4 * a * c; | ||
|
||
|
||
//if (Discriminant > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
На този етап не можеше да се ползва if
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Подсказка как да го направя без if? Как да разгледам отделните случаи за дискриминантата?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int D = b * b - 4 * a * c;
int x1 = (-b + sqrt(D)) / 2 * a;
int x2 = (-b - sqrt(D)) / 2 * a;
cout << "x1 = " << x1 << ", x2 = " << x2;*/
//b = a; | ||
//a = c; | ||
//cout << a << endl << b; | ||
//Задача 10.2 без допълнителна променлива - помощ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Help:
a=4,b=3
a=a+b; // a=7,b=3
b=a-b;// a=7,b=4
a=a-b;//a=3,b=4
No description provided.