online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <iostream> #include <cmath> using namespace std; int cDRecursive(int n, int i, int c) { if (i > sqrt(n)) { return c; // Базовый случай } if (n % i == 0) { c++; // Увеличиваем счётчик if (i != n / i) { c++; } } return cDRecursive(n, i + 1, c); // Рекурсивный вызов } int main() { setlocale(LC_ALL, "RUS"); int num; cout << "Введите натуральное число: "; cin >> num; if (num > 0) { int dC = cDRecursive(num, 1, 0); // Запускаем хвостовую рекурсию cout << "Количество делителей числа " << num << ": " << dC << endl; } else { cout << "Пожалуйста, введите натуральное число." << endl; } return 0; }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue