[{{mminutes}}:{{sseconds}}] X
Пользователь приглашает вас присоединиться к открытой игре игре с друзьями .
mydict
(0)       Используют 4 человека

Комментарии

Ни одного комментария.
Написать тут
Описание:
c++ code
Автор:
udfkjasdl
Создан:
22 апреля 2021 в 12:43 (текущая версия от 22 апреля 2021 в 12:44)
Публичный:
Нет
Тип словаря:
Тексты
Цельные тексты, разделяемые пустой строкой (единственный текст на словарь также допускается).
Содержание:
1 #include <iostream> using namespace std; class Complex { private: float real; float imag; public: Complex(): real(0), imag(0){ } void input() { cout << "Enter real and imaginary parts respectively: "; cin >> real; cin >> imag; } // Operator overloading Complex operator - (Complex c2) { Complex temp; temp.real = real - c2.real; temp.imag = imag - c2.imag; return temp; } void output() { if(imag < 0) cout << "Output Complex number: "<< real << imag << "i"; else cout << "Output Complex number: " << real << "+" << imag << "i"; } }; int main() { Complex c1, c2, result; cout<<"Enter first complex number:
"; c1.input(); cout<<"Enter second complex number:
"; c2.input(); // In case of operator overloading of binary operators in C++ programming, // the object on right hand side of operator is always assumed as argument by compiler. result = c1 - c2; result.output(); return 0; }

Связаться
Выделить
Выделите фрагменты страницы, относящиеся к вашему сообщению
Скрыть сведения
Скрыть всю личную информацию
Отмена