Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
418 changes: 418 additions & 0 deletions module-1/homework/BigInteger/biginteger.cpp

Large diffs are not rendered by default.

64 changes: 64 additions & 0 deletions module-1/homework/BigInteger/biginteger.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#include <vector>
#include <string>
#include <iostream>

class BigInteger {

private:
std::vector<int> numb ;
int zn = 1;

public:

BigInteger();
BigInteger(int);
BigInteger(std::string);

BigInteger& plus(BigInteger& x, const BigInteger& y);
BigInteger& minus(BigInteger& x, const BigInteger& y);

BigInteger operator+(const BigInteger& other);
BigInteger operator%(BigInteger other);
BigInteger operator-(BigInteger other);
BigInteger operator*(const BigInteger& other);
BigInteger operator/(const BigInteger& other);

BigInteger& operator=(BigInteger other);
BigInteger& operator=(int other);

BigInteger& operator++();
BigInteger operator++(int);
BigInteger& operator--();
BigInteger operator--(int);
BigInteger& operator-();

BigInteger& operator+=(const BigInteger& other);
BigInteger& operator%=(const BigInteger& other);
BigInteger& operator-=(const BigInteger& other);
BigInteger& operator*=(const BigInteger& other);
BigInteger& operator/=(const BigInteger& other);

bool operator<(const BigInteger& other);
bool operator>(const BigInteger& other);
bool operator==(const BigInteger& other);
bool operator<=(const BigInteger& other);
bool operator>=(const BigInteger& other);
bool operator!=(const BigInteger& other);

BigInteger& operator=(std::string other);

operator bool();

BigInteger operator*(int other);
BigInteger operator/(int other);
BigInteger& operator/=(int other);
BigInteger operator%=(int other);
BigInteger operator==(int other);


friend std::ostream& operator<<(std::ostream&, const BigInteger&);
friend std::istream& operator>>(std::istream&, BigInteger&);

std::string toString() const;

};
4 changes: 2 additions & 2 deletions module-1/homework/List/tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ int main() {
list_task2.remove(list_task2.front());
list_std2.remove(list_std2.front());

ASSERT_EQUAL_MSG(ToStdList(list_task), list_std, "list::remove")
ASSERT_EQUAL_MSG(ToStdList(list_task2), list_std2, "list::remove")

list_task.swap(list_task2);
list_std.swap(list_std2);
Expand Down Expand Up @@ -209,4 +209,4 @@ int main() {
}
}
}
}
}
6 changes: 6 additions & 0 deletions module-1/homework/TypeList/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"files.associations": {
"ratio": "cpp",
"type_traits": "cpp"
}
}
27 changes: 27 additions & 0 deletions module-1/homework/TypeList/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: g++ build active file",
"command": "/usr/bin/g++",
"args": [
"-g",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}"
],
"options": {
"cwd": "/usr/bin"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "compiler: /usr/bin/g++"
}
]
}
38 changes: 38 additions & 0 deletions module-1/homework/TypeList/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
cmake_minimum_required(VERSION 3.16)

include(GoogleTest)

project("runner")

configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)

execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .

RESULT_VARIABLE result
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download )

if(result)
message(FATAL_ERROR "CMake step for googletest failed: ${result}")
endif()
execute_process(COMMAND ${CMAKE_COMMAND} --build .
RESULT_VARIABLE result
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download )
if(result)
message(FATAL_ERROR "Build step for googletest failed: ${result}")
endif()

set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)

add_subdirectory(${CMAKE_CURRENT_BINARY_DIR}/googletest-src
${CMAKE_CURRENT_BINARY_DIR}/googletest-build
EXCLUDE_FROM_ALL)

if (CMAKE_VERSION VERSION_LESS 2.8.11)
include_directories("${gtest_SOURCE_DIR}/include")
endif()

add_subdirectory(typelist)
add_executable(runner tests.cpp)
target_link_libraries(runner LINK_PUBLIC typelist gtest_main)

add_test(NAME runner_test COMMAND runner)
15 changes: 15 additions & 0 deletions module-1/homework/TypeList/CMakeLists.txt.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
cmake_minimum_required(VERSION 2.8.2)

project(googletest-download NONE)

include(ExternalProject)
ExternalProject_Add(googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG master
SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/googletest-src"
BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/googletest-build"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
TEST_COMMAND ""
)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"requests":[{"kind":"cache","version":2},{"kind":"codemodel","version":2}]}
Loading