Добавлено решение задачи на C++

This commit is contained in:
Kraft291845
2025-11-26 08:46:03 +05:00
parent 6556ae2de4
commit 5f74ba5ef3
3 changed files with 32 additions and 0 deletions

BIN
CODE/LINUX/mat Executable file

Binary file not shown.

32
CODE/SOURCE/mat.cpp Executable file
View File

@@ -0,0 +1,32 @@
#include <iostream>
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;
}

BIN
CODE/WINDOWS_x64/mat.exe Executable file

Binary file not shown.