Удалить sum.cpp
This commit is contained in:
23
sum.cpp
23
sum.cpp
@@ -1,23 +0,0 @@
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
int sum(int a, int b) {
|
||||
if (a > b) {
|
||||
return 0;
|
||||
}
|
||||
return a + sum(a + 1, b);
|
||||
}
|
||||
|
||||
int main() {
|
||||
setlocale(0, "");
|
||||
int a;
|
||||
int b;
|
||||
cout << "Введiть a: ";
|
||||
cin >> a;
|
||||
cout << "Введiть b: ";
|
||||
cin >> b;
|
||||
|
||||
cout << "Сума чисел вiд " << a << " до " << b << " = " << sum(a, b) << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user