diff --git a/CODE/LINUX/mat b/CODE/LINUX/mat new file mode 100755 index 0000000..d1ed35c Binary files /dev/null and b/CODE/LINUX/mat differ diff --git a/CODE/SOURCE/mat.cpp b/CODE/SOURCE/mat.cpp new file mode 100755 index 0000000..c57d4bd --- /dev/null +++ b/CODE/SOURCE/mat.cpp @@ -0,0 +1,32 @@ +#include + +using namespace std; + +int main() { + + int A, B; + + cout << "Entry A: "; + cin >> A; + + cout << "Entry B: "; + cin >> B; + + int n = 0; + float result; + + while (true) { + + result = A - n * (n+1) / 2; + + if (result < B) { + cout << "RESULT: " << result << endl; + break; + } + + n += 1; + } + + + return 0; +} \ No newline at end of file diff --git a/CODE/WINDOWS_x64/mat.exe b/CODE/WINDOWS_x64/mat.exe new file mode 100755 index 0000000..f121517 Binary files /dev/null and b/CODE/WINDOWS_x64/mat.exe differ