Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<string>
- using namespace std;
- int main() {
- setlocale(LC_ALL, "Russian");
- double x;
- double otvet_a, otvet_b, otvet_c;
- cout << "Введите x ";
- cin >> x;
- if (x <= 0) {
- cout << " 1/cos(x) не определен " << endl;
- if (1 + abs(x) > 1 + x * 2 * x)
- cout << "1 + x*2*x = " << 1 + x * 2 * x << " 1 + abs(x) =" << 1 + abs(x) << endl;
- else
- cout << " 1 + abs(x) =" << 1 + abs(x) << "1 + x*2*x = " << 1 + x * 2 * 1 << endl;
- }
- else
- {
- otvet_a = 1 / cos(x);
- otvet_b = 1 + abs(x);
- otvet_c = 1 + x * 2 * x;
- if (otvet_a < otvet_b && otvet_a < otvet_c) {
- if (otvet_b < otvet_c) {
- cout << "1/cos = " << otvet_a << endl;
- cout << " 1+x*2*x = " << otvet_b << endl;
- cout << " 1+abs(x) = " << otvet_c << endl;
- }
- else {
- cout << "1/cos = " << otvet_a << endl;
- cout << " 1+abs(x) = " << otvet_c << endl;
- cout << " 1+x*2*x = " << otvet_b << endl;
- }
- }
- if (otvet_b < otvet_a && otvet_b < otvet_c) {
- if (otvet_a < otvet_c) {
- cout << " 1+x*2*x = " << otvet_b << endl;
- cout << "1/cos = " << otvet_a << endl;
- cout << " 1+abs(x) = " << otvet_c << endl;
- }
- else {
- cout << " 1+x*2*x = " << otvet_b << endl;
- cout << " 1+abs(x) = " << otvet_c << endl;
- cout << "1/cos = " << otvet_a << endl;
- }
- }
- if (otvet_c < otvet_a && otvet_c < otvet_b) {
- if (otvet_a < otvet_b) {
- cout << " 1+abs(x) = " << otvet_c << endl;
- cout << "1/cos = " << otvet_a << endl;
- cout << " 1+x*2*x = " << otvet_b << endl;
- }
- else {
- cout << " 1+abs(x) = " << otvet_c << endl;
- cout << " 1+x*2*x = " << otvet_b << endl;
- cout << "1/cos = " << otvet_a << endl;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement