#include <iostream>
usingnamespace std;
int Persistent(int value)
{
int counter = 0;
while (value > 10)
{
int newvalue = 1;
int tmpvalue = value;
while (tmpvalue > 0)
{
// I get the last digit
int tmp = tmpvalue % 10;
newvalue *= tmp;
// last digit is cut
tmpvalue /= 10;
}
value = newvalue;
cout << "element: " << value << endl;
counter++;
}
return counter;
}
int main()
{
int originalNumber(715);
cout << "Please enter a non negative number" << endl;
cin >> originalNumber >>
cout << originalNumber << endl;
cout << " number of element: " << Persistent(715);
return 0;
return 0;
}