online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <iostream> #include <cstring> using namespace std; int f(char* str, int i) { if (i == 0) return int(str[i]) - int('0'); else return (int(str[i]) - int('0')) * f(str, i - 1); } int main() { char str[10]; int t; while (cin >> str) { int count = 0; while (strlen(str) > 1) { int k = strlen(str) - 1; t = f(str, k); memset(str, 0, sizeof(str) / sizeof(str[0])); sprintf(str, "%d", t); count++; } cout << count << 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