This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "dynamicarray.h" | |
DynamicArray::DynamicArray() : arrayData_(nullptr), arrayLength_(0) {} | |
DynamicArray::DynamicArray(const DynamicArray& otherArray) | |
{ | |
if (otherArray.arrayLength_ == 0) | |
{ | |
arrayData_ = nullptr; | |
arrayLength_ = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <math.h> | |
#include <assert.h> | |
#include <iostream> | |
#include <numbers> | |
#include "complex.h" | |
ComplexNumber::ComplexNumber(const float real, const float imag) : | |
real_(real), imag_(imag) {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string> | |
#include <iostream> | |
#include <vector> | |
int main() | |
{ | |
std::string str1, str2; | |
// Операция >> считывает строку до первого пробела | |
// Функция std::getline - до первого перевода строки |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "complex.h" | |
#include <math.h> | |
#include <assert.h> | |
#include <iostream> | |
#include <numbers> | |
ComplexNumber::ComplexNumber(const float real, const float imag) : | |
real_(real), imag_(imag) {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <random> | |
#include <chrono> | |
#include <iostream> | |
int main() | |
{ | |
// Инициализация генератора случайных чисел | |
std::random_device randomDevice; | |
std::mt19937_64 generator(randomDevice()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "complex.h" | |
#include <math.h> | |
#include <iostream> | |
ComplexNumber ComplexNumber::conjugate() const | |
{ | |
ComplexNumber result; |