Answer the question
In order to leave comments, you need to log in
What is the error, why does it give a compilation error?
#include <iostream>
#include <cmath> //нужно для pow()
#include <utility>
#include <functional>
using namespace std;
int main()
{
double z,a,b,y,c,d;
cout <<"Введите вещественную и мнимую части числа z"<<endl;
cin>> a>> b;
cout <<"Введите вещественную и мнимую части числа y"<<endl;
cin>> c >> d ;
z = make_pair (a,b);
y = make_pair (c,d);
if(z == y) {
cout << "Модуль равна " << pow(pow(z.first,2)+pow(y.second,2),0.5);
}
else {
cout <<"Мнимая часть y= " << y.second;
}
}
Answer the question
In order to leave comments, you need to log in
pair <double, double> z = make_pair(a, b);
pair <double, double> y = make_pair(c, d);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question