Quick actions

cmd+k|ctrl+k

Navigation

Languages

Лаб 2

Snippet info

Language

Cpp

Visibility

public

Author

grekich505

Created

2019-12-18T18:03:12Z

Updated

2019-12-18T18:59:46Z

#include <iostream>
#include <cmath>
#include <math.h>
using namespace std;

void task41() {
    cout << "Задание№41\n";
    int a;
    int b;
    int c;
    int d;
    double z1;
    double z2;
    double Z;
    cin >> a;
    cin >> b;
    cin >> c;
    cin >> d;
    if(a==0 || d==0) {
        
       cout << "Нет решений" << endl;
    }
    else
    
    z1=(a*d+b*c);
    z2=a*d;
    Z=z1/z2;
    cout << "Ответ: " << Z << endl;
    
    
}

void task20(){
    cout << "\nЗадание№20\n";
    int x;
    int y;
    double z1;
    double z2;
    double Z;
    cin >> x;
    cin >> y;
    if (cos(12*y-4) == 0){
        cout << "Решений нет" << endl;
        
    }
    else
    
    z1=1+sin(sqrt(x+1));
    z2=cos(12*y-4);
    Z=z1/z2;
    cout << "Ответ: " << Z << endl;
}

void task45(){
    cout << "\nЗадание№45\n";
    int x;
    double Z;
    cin >> x;
    Z=abs(1 - abs(x));
    cout << "Ответ: " << Z << endl;
}

void task24(){
    cout << "\nЗадание№24\n";
    int x;
    double Z;
    cin >> x;
    Z=x-10*sin(x)+abs(pow(x,4)-pow(x,5));
    cout << "Ответ: " << Z << endl;
}

void task3(){
    cout << "\nЗадание№3\n";
    int x;
    int y;
    double z1;
    double z2;
    double z3;
    double Z;
    cin >> x;
    cin >> y;
    if(cos(x)-sin(y)==0 || cos(x)==sin(y) ) {
        
       cout << "Нет решений" << endl;
    }
    else
    
    z1=sin(y)+sin(x);
    z2=cos(x)-sin(y);
    z3=z1/z2;
    Z=z3*(sin(x*y)/cos(x*y));
    cout << "Ответ: " << Z << endl;
    
    
    
}

int main() {
    setlocale(LC_ALL, "Russian");
    task41();
    task20();
    task45();
    task24();
    task3();
}
INFO